Author Topic: Channel Message Direction Modification  (Read 12045 times)

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Channel Message Direction Modification
« on: September 06, 2018, 01:03:16 PM »
Hi

Help me on direction for channel message alteration because in my cases both leg are considered as outgoing, so i need to modify one leg  as incoming for proper clearance on CDR and other related information.

Steps Followed :
  • Enqueue the call.execute using dumb with billid. And dumb channel are considered as incoming but cdrtrack is set as false where-as it's not necessary.
  • Sig Channel generated from call.execute for ISDN call. CDR initialized with direction as outgoing.
  • Once ISDN call answered then dispatching call.route to find the routing part. Handler installed for call.answered message.
  • Check the result call.route and Enqueue chan.masquerade with message of call.execute with id = Sig Channel(sig/1) / id of call.answered message
  • So this call.execute also executing with direction as incoming.

 My both leg are considered as outgoing under cdrtracking scheme. And there is no incoming, so cdrcombine is not finalized and my other CDR logging also difficult to find the both leg due to both are as incoming leg.

So clarify me few things.
  • Is it Normal Behavior ?
  • Is there any wrong handled the message by this logic ?
  • Changing direction is good idea ?.If then point me the direction out !
  • Some extra logic need to apply to find each leg on this call is the proper solution on this cases ?.
  • Extra logic need to track this Sig ISDN call for hangup to clean-up blank entry with billid on cdrcombine and how to clean entry ?

Yate Version :6.0.1
Calling Medium : PRI with Zaptel module


Kindly help me out !
« Last Edit: September 06, 2018, 01:05:01 PM by ganapathi »

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Channel Message Direction Modification
« Reply #1 on: September 18, 2018, 07:35:46 AM »
Hi,

You should not use cdrcombine for this kind of application.

You should use your own logic to track and manage channels belonging to the same call. Your script may retain any information it needs to implement your application (remember: for outgoing calls you may dispatch the call.execute message and learn the target channel's id on return).

You may also use custom CDR parameters for this: when you start a call custom parameters (given in 'copyparams': comma separated list of parameter names) may be copied in chan.startup message which will be stored and used by cdrbuild if configured so.
Custom parameters will be set in all call.cdr messages sent by cdrbuild.

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Channel Message Direction Modification
« Reply #2 on: September 18, 2018, 08:03:54 AM »
Thanks a lot  for reply !!

So it means nothing wrong on direction and handling of leg.

I am not using cdrcombine module nowadays. but only if i use custom parameters then it won't copy into both outbound cdr leg right. ?. As i seen some of parameters are copied on both leg at long back.

And yes for outgoing calls am using target channel ID to dispatch new local leg .

But for some reason i didn't disabled cdrcombine , so in that case any possiblities to remove cdrcombine entry forcefully by sending message?

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Channel Message Direction Modification
« Reply #3 on: September 18, 2018, 08:13:08 AM »
When used in call.execute parameters set in 'copyparams' are copied in outbound call leg's chan.startup.

Please unload cdrcombine.

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Channel Message Direction Modification
« Reply #4 on: September 18, 2018, 08:34:06 AM »
Ok

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Channel Message Direction Modification
« Reply #5 on: September 24, 2018, 02:36:41 AM »
Hi

As i added one new custom parameters in cdrbuild.conf as

custom_direction = true

And added custom_direction field into copyparams of both leg. And assigned different value on each leg. But values are overridden on each leg.

As i need to maintain different value in custom_direction on each leg with same name to identify the call leg.

How do i that. Please help me !

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Channel Message Direction Modification
« Reply #6 on: September 24, 2018, 02:47:03 AM »
Please post a log with message sniffer enabled.

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Channel Message Direction Modification
« Reply #7 on: September 24, 2018, 03:17:45 AM »
Hi

Field = TB_Direction.

For Sig Channel
TB_direction = external
For Sip Channel
TB_direction = incoming

further both channel cdr also have same value as "incoming".

Log : https://paste.linux.community/view/2c14381c

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Channel Message Direction Modification
« Reply #8 on: September 24, 2018, 03:49:27 AM »
TB_direction is missing in initial call.execute message 'copyparams' parameter list

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Channel Message Direction Modification
« Reply #9 on: September 24, 2018, 11:45:28 PM »
Attached revised log with two different cases.

1.Once first leg(sig channel) then call.route doesn't have TB_direction value.But call.execute of second leg assigning it properly.

2.Emit TB_direction value on call.route as well.(https://paste.linux.community/view/07e04e04)


marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Channel Message Direction Modification
« Reply #10 on: September 24, 2018, 11:59:30 PM »
How did you configure parameter storage in cdrbuild?
Did you disabled override?
See https://docs.yate.ro/wiki/CDR_Build_Module

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Channel Message Direction Modification
« Reply #11 on: September 25, 2018, 12:16:24 AM »
Hi
 I configured cdrbuild parameters like mentioned below in cdrbuild.conf configuration.

[parameters]

TB_direction=true

Anything else need to be configure ?

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Channel Message Direction Modification
« Reply #12 on: September 25, 2018, 12:31:02 AM »
You are allowing changing this parameter after creation.
Set it to false.

ganapathi

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: Channel Message Direction Modification
« Reply #13 on: September 25, 2018, 08:50:58 AM »
Thanks. It's working as excepted for this scenario.

So if i want to re-modify in-between on handler but only on particular leg then it's possible ?

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Channel Message Direction Modification
« Reply #14 on: September 25, 2018, 11:57:29 PM »
No.
You may use another parameter that can be updated in cdrbuild.