[ previous ] [ next ] [ threads ]
 To :  Ganapathi Chidambaram <ganapathi.rj@g...>
 From :  Monica Tepelus <monica@v...>
 Subject :  Re: [yate] Parameter Assign on Another Module
 Date :  Fri, 2 Feb 2018 15:42:17 +0200
This method allows you to copy parameters in call.cdr related message, 
not in all messages. It won't be copied to chan.disconnected.

If you need it in chan.disconnected you could run a query if you store 
the cdrs in the database after chan_id / store it in global variable in 
your script and use it & clean it when receiving 
chan.disconnected/chan.hangup.

Regards,
Monica Tepelus

On 02/01/2018 04:54 PM, Ganapathi Chidambaram wrote:
> Sorry for failed to clarify my requirement.
>
> But I believe your assumption is exactly correct.
>
> As I need to assign a custom parameter value in 
> call.route/call.preroute and trying to get value in another message 
> update like call.cdr / cdr.combined/chan.disconnected .
>
> Ex:
>
> cdrbuild.conf mentioned it already.
>
> [parameters]
> call_direction=true;
>
> Under call.route message I just assigning value for call_direction as INB
> Yate::install(“call.route”)
> If($message->direction = “incoming”)
> {
> $message->params[“call_direction”]=“inb”;
> }
>
> And I need to get parameter value in chan_disconnected message processing.
>
> Yate::install(“call.disconnected”)
> If($message->direction = “incoming”)
> {
> print $message->params[“call_direction”]; // Output should be “inb”.
> }
>
>
> According to your information if I mark “call_direction” under 
> copyparams  then can I get value of call_direction under 
> chan_disconnected/call.cdr? If yes then simply mentioning parameter 
> name or anything else to register/mentioned to get value of the same.
>
>
> Regards,
> Ganapathi Chidambaram
>
>
> On 01-Feb-2018, at 4:21 PM, Monica Tepelus  > wrote:
>
>> Hi,
>>
>> It's not clear what you want to achieve.
>>
>> Also:
>> chan.disconnected is a message (not a module).
>>
>> If your purpose is to propagate a parameter you usually set it in 
>> routing (call.route/call.preroute message) and also need to add in it 
>> the "copyprams" parameter in which you set the names of the 
>> parameters you want to be copied. You could then modify it after 
>> receiving chan.disconnected. I don't think parameters added in 
>> chan.disconnected are copied, but you could send a call.update for 
>> that id when receiving the chan.disconnedted
>>
>> Ex:
>>
>> Yate::Install("call.route");
>>
>> ...
>>
>> if ($message->called marches rule) {
>>          $message->params["call_direction"] = "..";
>>          $message->params["copyparams"] = 
>> "call_direction,another_param_if_needed";
>> }
>>
>> You would also need to modify cdrbuild.conf
>> [parameters]
>> call_direction=true;
>>
>> This is the documentation article:
>> http://docs.yate.ro/wiki/How_to_add_custom_parameters_in_CDR_from_routing
>>
>> Regards,
>> Monica Tepelus
>>
>> On 10/07/2017 03:30 PM, Ganapathi Chidambaram wrote:
>>> Hi
>>>
>>> As i need to assign one value while listening one 
>>> module(chan.disconnected) and need to assign the value on another 
>>> module(call.cdr) by using external module.
>>>
>>> Will you please guys help me for the same.
>>>
>>>
>>> Yate::Install("chan.disconnected",80);
>>>
>>> call_cdr->params["call_direction"]='xyz';
>>>
>>>
>>> Regards,
>>> Ganapathi
>>>
>>>
>>





  
    
  
  
    This method allows you to copy parameters in call.cdr related
    message, not in all messages. It won't be copied to
    chan.disconnected.

If you need it in chan.disconnected you could run a query if you store the cdrs in the database after chan_id / store it in global variable in your script and use it & clean it when receiving chan.disconnected/chan.hangup.

Regards,
Monica Tepelus

On 02/01/2018 04:54 PM, Ganapathi Chidambaram wrote:
Sorry for failed to clarify my requirement. 

But I believe your assumption is exactly correct.

As I need to assign a custom parameter value in call.route/call.preroute and trying to get value in another message update like call.cdr / cdr.combined/chan.disconnected .

Ex:

cdrbuild.conf mentioned it already.

[parameters]
call_direction=true;

Under call.route message I just assigning value for call_direction as INB
Yate::install(“call.route”)
If($message->direction = “incoming”)
{
$message->params[“call_direction”]=“inb”;
}

And I need to get parameter value in chan_disconnected message processing.

Yate::install(“call.disconnected”)
If($message->direction = “incoming”)
{
print $message->params[“call_direction”]; // Output should be “inb”.
}


According to your information if I mark “call_direction” under copyparams  then can I get value of call_direction under chan_disconnected/call.cdr? If yes then simply mentioning parameter name or anything else to register/mentioned to get value of the same.


Regards,
Ganapathi Chidambaram 


On 01-Feb-2018, at 4:21 PM, Monica Tepelus <monica@v...> wrote:

Hi,

It's not clear what you want to achieve.

Also:
chan.disconnected is a message (not a module).

If your purpose is to propagate a parameter you usually set it in routing (call.route/call.preroute message) and also need to add in it the "copyprams" parameter in which you set the names of the parameters you want to be copied. You could then modify it after receiving chan.disconnected. I don't think parameters added in chan.disconnected are copied, but you could send a call.update for that id when receiving the chan.disconnedted

Ex:

Yate::Install("call.route");

...

if ($message->called marches rule) {
         $message->params["call_direction"] = "..";
         $message->params["copyparams"] = "call_direction,another_param_if_needed";
}

You would also need to modify cdrbuild.conf
[parameters]
call_direction=true;

This is the documentation article:
http://docs.yate.ro/wiki/How_to_add_custom_parameters_in_CDR_from_routing

Regards,
Monica Tepelus

On 10/07/2017 03:30 PM, Ganapathi Chidambaram wrote:
Hi

As i need to assign one value while listening one module(chan.disconnected) and need to assign the value on another module(call.cdr) by using external module.

Will you please guys help me for the same.


Yate::Install("chan.disconnected",80);

call_cdr->params["call_direction"]='xyz';


Regards,
Ganapathi