[asterisk-users] Doubt about cdr on asterisk
Luiz Gustavo Chiaretto
luiz.gustavo at freeddom.com
Wed Mar 2 10:38:48 CST 2011
Thanks for your answer Danny,
I thought there was another solution using some cdr options.
Best Regards.
Luiz Gustavo Chiaretto
----- Original Message -----
From: "Danny Nicholas" <danny at debsinc.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
Sent: Wednesday, March 2, 2011 11:42:58 AM
Subject: Re: [asterisk-users] Doubt about cdr on asterisk
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Luiz Gustavo Chiaretto
Sent: Wednesday, March 02, 2011 8:34 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Doubt about cdr on asterisk
I have the following situation....
I'm using Action Originate to originate a call for a costumer. Originate goes to a context that call the dial application. Before the application (Dial using the G option) to be invoked i'm setting the variable cellphone like this:
[firstcontext]
exten => s,1,Set(CDR(cellphone)=${CELLPHONE})
exten => s,n,Dial(IAX2/user:pass at otherasterisk/${CELLPHONE},30,G(secondcontext^s^1))
[secondcontext]
exten => s,1,Hangup()
exten => s,n,Playback(something)
exten => s,n,NoOp(CDR(cellphone)
exten => s,n,Hangup()
When the costumer answer the call, caller party goes to secondcontex on extension 1 and the called party goes to secondcontex on extension 2. On firstcontext (before the Dial) i can see the value of variable cellphone, but on my secondcontext (after Dial) the variable CDR(cellphone) is blank.
Is there something that i can do to pass the value after Dial application?
You can’t depend on CDR to hold this value because you create a new CDR instance with the Dial application. You can set a local variable and reload CDR(cellphone) after the Dial, like this
[firstcontext]
exten => s,1,Set(CDR(cellphone)=${CELLPHONE})
exten => s,n,Set(holdcellphone=${CELLPHONE})
exten => s,n,Dial(IAX2/user:pass at otherasterisk/${CELLPHONE},30,G(secondcontext^s^1))
[secondcontext]
exten => s,1,Hangup()
exten => s,n,Playback(something)
Exten => s,n,Set(CDR(cellphone)=${holdcellphone})
exten => s,n,NoOp(CDR(cellphone)
exten => s,n,Hangup()
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110302/76127af7/attachment.htm>
More information about the asterisk-users
mailing list