[asterisk-users] CDR custom variable on second call leg - via originate or .call file

Matthew Jordan mjordan at digium.com
Wed Jun 11 13:24:55 CDT 2014


On Wed, Jun 11, 2014 at 9:10 AM, Tiago Geada <tiago.geada at gmail.com> wrote:

> Hi,
>
> Let me append some extra info
>
> cdr variable foo, shows on database, but value 'bar' doens't
>
> its not even shown in the insert query
>
> I tried with master_channel but no change
>
>
I think you need to be a bit more specific about what CDR records you're
getting and what you'd like to have happen.

You have the following call file:

<snip>


>
>>
>>
>>
>> ## test call file
>>
>>
>>
>> Channel: Local/queue at TiagoGeada
>>
>> CallerID: teste-geada:0:210332450:
>>
>> MaxRetries: 0
>>
>> RetryTime: 1
>>
>> WaitTime: 8640
>>
>> Account: teste-geada
>>
>> Context: TiagoGeada
>>
>> Extension: outbound
>>
>> Archive: Yes
>>
>>
>>
>>
>>
>
This will create a Local channel with two halves. The ;2 half will execute
in the dialplan at TiagoGeada,queue,1 - the ;1 half will execute in the
dialplan at TiagoGeada,outbound,1. The ;2 Local channel will execute first
until it is Answered; once Answered, that will trigger the ;1 half to start
execution. That will create two CDRs, one for each Local channel half.

MASTER_CHANNEL won't apply here, as MASTER_CHANNEL only applies to a
Parent/Child relationship between channels, that is, when one channel has
created another channel. This occurs when a channel dials another channel.
The ;1 side didn't create the ;2 side, they are effectively two sides of
the same "channel".



>
>>
>>
>>
>> ## dialplan
>>
>>
>>
>>         queue => {
>>
>>                 Set(CDR(remoteUid)=foo);
>>
>>                 Queue(TiagoGeada,t,,,100);
>>
>>                 Hangup();
>>
>>         }
>>
>>
>>
>>         outbound => {
>>
>>                 //NoCDR();
>>
>>                 //ForkCDR(vdD);
>>
>>                 //ResetCDR(v);
>>
>>                 Set(CDR(remoteUid,r)=bar);
>>
>>                 Dial(Local/932485457 at outbound,,gT);
>>
>>                 Hangup();
>>
>>         }
>>
>>
>>
Looking at your Dialplan for the outbound extension, you dial yet another
Local channel. I would expect this to result in 3 CDR entries:

Source Channel                 Destination Channel
Local/queue at TiagoGeada;2
Local/queue at TiagoGeada;1       Local/932485427 at outbound;1
Local/932485457 at outbound;2

So, the question is, which CDR are you talking about? What value do you
want where? Keep in mind that unless all channels are answered, they won't
show up in your CDRs (unless you have unanswered=yes set in cdr.conf).

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140611/e231a84d/attachment.html>


More information about the asterisk-users mailing list