Hi all, Does anyone know how to get the channel ID on the other side of the call? For example: When SIP/50 calls SIP/21, and the call is answered by SIP/21 I get: SIP/21-6735 answered SIP/50-b456 ${CHANNEL} will show me SIP/50-b456. Is there a parameter or a workaround to get the SIP/21-6735 part? Thanks. Assaf Benharoosh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050107/f472f76d/attachment.htm
<<Does anyone know how to get the channel ID on the other side of the call?>> Assaf, I don't know if there is such an ID available. However if there is not, the value you want is pushed out in one of the events that Asterisk publishes to AGI connections when a call is constructed. As it result it ought to be possible to write an AGI script using, say, Perl to capture this value and write it back as a Dialplan variable. Bill Seddon _____ From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Assaf Benharoosh Sent: January 08, 2005 12:27 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Channel Variable Hi all, Does anyone know how to get the channel ID on the other side of the call? For example: When SIP/50 calls SIP/21, and the call is answered by SIP/21 I get: SIP/21-6735 answered SIP/50-b456 ${CHANNEL} will show me SIP/50-b456. Is there a parameter or a workaround to get the SIP/21-6735 part? Thanks. Assaf Benharoosh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050108/40ea9f2d/attachment.htm
Bill, Are you sure there's an AGI enviroment variable that gives me that? I couldn't find any: -- accountcode -- callerid = "Assaf Benharoosh" <21> -- channel = SIP/26-f39a -- context = extensions -- dnid = 45 -- enhanced = 0.0 -- extension = 45 -- language = en -- priority = 1 -- rdnis = unknown -- request = agi-test.agi -- type = SIP -- uniqueid = 1105227054.140 I'm trying to get the other side channel string. If I run the AGI before the dial- is it all possible? Assaf Benharoosh MCP, MCSA, MCSE ab@franticllc.com <blocked::mailto:ab@franticllc.com> Frantic, LLC. 246 West 38th Street 2nd Floor New York, NY 10018 T: (212) 302-5790 F: (646) 201-9418 C: (516) 805-7981 ________________________________ From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Bill Seddon Sent: Saturday, January 08, 2005 4:21 AM To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: RE: [Asterisk-Users] Channel Variable <<Does anyone know how to get the channel ID on the other side of the call?>> Assaf, I don't know if there is such an ID available. However if there is not, the value you want is pushed out in one of the events that Asterisk publishes to AGI connections when a call is constructed. As it result it ought to be possible to write an AGI script using, say, Perl to capture this value and write it back as a Dialplan variable. Bill Seddon ________________________________ From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Assaf Benharoosh Sent: January 08, 2005 12:27 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Channel Variable Hi all, Does anyone know how to get the channel ID on the other side of the call? For example: When SIP/50 calls SIP/21, and the call is answered by SIP/21 I get: SIP/21-6735 answered SIP/50-b456 ${CHANNEL} will show me SIP/50-b456. Is there a parameter or a workaround to get the SIP/21-6735 part? Thanks. Assaf Benharoosh -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050108/8fd954b8/attachment.htm
Hi, I have set some variable in a call. Set(testmode=1) For some reason, such as forward the call, the follow command called. Dial(Local/1234567) It will go through the dial plan again but the value of variable testmode is nothing instead of 1. How can I maintain the value of the variable in the above case? unplug
In article <6fbb529e0608240138m3204cbf2kae603b0d982cb45@mail.gmail.com>, unplug <maillisting@gmail.com> wrote:> Hi, > > I have set some variable in a call. > Set(testmode=1) > For some reason, such as forward the call, the follow command called. > Dial(Local/1234567) > It will go through the dial plan again but the value of variable > testmode is nothing instead of 1. > > How can I maintain the value of the variable in the above case?Try using Set(__testmode=1), but still refer to it as ${testmode}. The __ tells Asterisk to propagate the variable to created channels. Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org
Do you mean it is a global variable instead of channel variable?> > Try using Set(__testmode=1), but still refer to it as ${testmode}. > > The __ tells Asterisk to propagate the variable to created channels. > > Cheers > Tony > -- > Tony Mountifield > Work: tony@softins.co.uk - http://www.softins.co.uk > Play: tony@mountifield.org - http://tony.mountifield.org > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
In article <6fbb529e0608240234x32c224ax37760dd5b989b594@mail.gmail.com>, unplug <maillisting@gmail.com> wrote:> Tony Mountifield wrote: > > > > Try using Set(__testmode=1), but still refer to it as ${testmode}. > > > > The __ tells Asterisk to propagate the variable to created channels. > > Do you mean it is a global variable instead of channel variable?No, it is a channel variable. The __ on the beginning means it will be inherited by any channels created from the channel it was set on. See the section called "Inheritance of Channel Variables" on http://www.voip-info.org/wiki/view/Asterisk+variables In fact you will find that there is a LOT of useful info on that site. Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org
On 8/24/06, Tony Mountifield <tony@softins.clara.co.uk> wrote:> In article <6fbb529e0608240234x32c224ax37760dd5b989b594@mail.gmail.com>, > unplug <maillisting@gmail.com> wrote: > > Tony Mountifield wrote: > > > > > > Try using Set(__testmode=1), but still refer to it as ${testmode}. > > > > > > The __ tells Asterisk to propagate the variable to created channels. > > > > Do you mean it is a global variable instead of channel variable? > > No, it is a channel variable. The __ on the beginning means it will be > inherited by any channels created from the channel it was set on.In following up with this very old thread... I was just playing with variable inheritance, and if you are calling Set(__MYVAR=myval), and then go off somewhere else (in my case it was via a GoSub()), and Set(MYVAL=myotherval), then you effectively set the variable local again and it will not be inherited. My trick was to do a Set(__MYVAL=${MYVAL}) right before Dial()ing the Local channel. This will forward the current value to the Local channel. -- Leif Madsen. http://www.leifmadsen.com http://www.oreilly.com/catalog/asterisk