Re: [asterisk-users] setting variable for a DID number
jzhehd Ksjfyejzhehd Sent from an unlocked GSM Palm Pre Plus on T-Mobile On Aug 19, 2010 12:50 PM, Tino lt;t...@sparksupport.comgt; wrote: But when i call my DID number following dialplans are being executed.nbsp; What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. - nbsp;NoOp(SIP/5070-5407, Received incoming SIP connection from unknown peer to lt;DID NUMBERgt;) in new stack nbsp;nbsp;nbsp; -- Executing [lt;DID NUMBERgt;@from-sip-external:2] Set(SIP/5070-5407, DID=lt;DID NUMBERgt;) in new stack nbsp;nbsp;nbsp; -- Executing [lt;DID NUMBERgt;@from-sip-external:3] Goto(SIP/5070-5407, s|1) in new stack nbsp;nbsp;nbsp; -- Goto (from-sip-external,s,1) nbsp;nbsp;nbsp; -- Executing [...@from-sip-external:1] GotoIf(SIP/5070-5407, 1?checklang:noanonymous) in new stack nbsp;nbsp;nbsp; -- Goto (from-sip-external,s,2) nbsp;nbsp;nbsp; -- Executing [...@from-sip-external:2] GotoIf(SIP/5070-5407, 0?setlanguage:from-trunk|lt;DID NUMBERgt;|1) in new stack nbsp;nbsp;nbsp; -- Goto (from-trunk,lt;DID NUMBERgt;,1) nbsp;nbsp;nbsp; -- Executing [lt;DID NUMBERgt;@from-trunk:1] Set(SIP/5070-5407, __FROM_DID=lt;DID NUMBERgt;) in new stack nbsp;nbsp;nbsp; -- Executing [lt;DID NUMBERgt;@from-trunk:2] Gosub(SIP/5070-5407, app-blacklist-check|s|1) in new stack nbsp;nbsp;nbsp; -- Executing [...@app-blacklist-check:1] LookupBlacklist(SIP/5070-5407, ) in new stack nbsp;nbsp;nbsp; -- Executing [...@app-blacklist-check:2] GotoIf(SIP/5070-5407, 0?blacklisted) in new stack nbsp;nbsp;nbsp; -- Executing [...@app-blacklist-check:3] Set(SIP/5070-5407, CALLED_BLACKLIST=1) in new stack nbsp;nbsp;nbsp; -- Executing [...@app-blacklist-check:4] Return(SIP/5070-5407, ) in new stack nbsp;nbsp;nbsp; -- Executing [lt;DID NUMBERgt;@from-trunk:3] ExecIf(SIP/5070-5407, 0 |Set|CALLERID(name)=Anonymous) in new stack nbsp;nbsp;nbsp; -- Executing [lt;DID NUMBERgt;@from-trunk:4] Set(SIP/5070-5407, __CALLINGPRES_SV=allowed_not_screened) in new stack nbsp;nbsp;nbsp; -- Executing [lt;DID NUMBERgt;@from-trunk:5] SetCallerPres(SIP/5070-5407, allowed_not_screened) P.S : used lt;DID NUMBERgt; in place of actual DID number -- _ -- 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
Re: [asterisk-users] setting variable for a DID number
On Thu, 19 Aug 2010, Tino wrote: But when i call my DID number following dialplans are being executed. What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. On Thu, Aug 19, 2010 at 11:01 PM, Steve Edwards asterisk@sedwards.com wrote: exten = _x.,n, set(FOO=XXX) exten = _x.,n, execif($[${ANI} = 551212],set,FOO=YYY}) On Thu, 19 Aug 2010, Sherwood McGowan wrote: Oh boy...Ok, first, let's get into the root issue here...First, when a variable is set during a call, unless it's defined as a GLOBAL variable, it is only accessible to THE CHANNEL THAT EXECUTED THE SET COMMAND THAT CAUSED THE VARIABLE TO EXIST. [snip] On Thu, 19 Aug 2010, Sherwood McGowan wrote (in an unrelated post): I'll leave the Surely you thought of checking THIS discussion for when I'm a little less likely to spill Jameson and/or Guiness on me lappy I think you got more down your gullet than in your lap :) The OP said any contexts not any channels. Sherwood Mother-F'ing McGowan Because I'm the Mickand I'm awesome P.S. a Sixpack of your choosing to the first person who can correctly identify the person or character the last line of that signature was parodying Depending on what you find entertaining, either Miz (WWE) or Barney (HIMYM). Boddington's will be most acceptable. Unfortunately, on this side of the pond they only sell it in a 4pack. -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000-- _ -- 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
Re: [asterisk-users] setting variable for a DID number
A boddingtons... Anyway, let me point out that the CONTEXT has nothing to do with 'access' to a variable...if a call (channel) causes a variable to be assigned a value, then that calland possibly it's 'children' if inheritance is set up. It doesntmatter what context the call ends up being routed to, it will ALWAYs have acces to that variable unless it wascreated as a LOCAL variable in a macro Now, I knew the OP said context, but context does not matter, asterisk looks to see which CHANNEL has access to a variable's instanceI'll behappy tofurther expound upon thiswhen I get back to mylaptop Sent from my iPhone On Aug 20, 2010, at 2:09 AM, Steve Edwards asterisk@sedwards.com wrote: On Thu, 19 Aug 2010, Tino wrote: But when i call my DID number following dialplans are being executed. What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. On Thu, Aug 19, 2010 at 11:01 PM, Steve Edwards asterisk@sedwards.com wrote: exten = _x.,n, set(FOO=XXX) exten = _x.,n, execif($[${ANI} = 551212],set,FOO=YYY}) On Thu, 19 Aug 2010, Sherwood McGowan wrote: Oh boy...Ok, first, let's get into the root issue here...First, when a variable is set during a call, unless it's defined as a GLOBAL variable, it is only accessible to THE CHANNEL THAT EXECUTED THE SET COMMAND THAT CAUSED THE VARIABLE TO EXIST. [snip] On Thu, 19 Aug 2010, Sherwood McGowan wrote (in an unrelated post): I'll leave the Surely you thought of checking THIS discussion for when I'm a little less likely to spill Jameson and/or Guiness on me lappy I think you got more down your gullet than in your lap :) The OP said any contexts not any channels. Sherwood Mother-F'ing McGowan Because I'm the Mickand I'm awesome P.S. a Sixpack of your choosing to the first person who can correctly identify the person or character the last line of that signature was parodying Depending on what you find entertaining, either Miz (WWE) or Barney (HIMYM). Boddington's will be most acceptable. Unfortunately, on this side of the pond they only sell it in a 4pack. -- Thanks in advance, --- -- Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _ -- 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 -- _ -- 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
Re: [asterisk-users] setting variable for a DID number
On Thu, 19 Aug 2010, Tino wrote: But when i call my DID number following dialplans are being executed. What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. On Fri, 20 Aug 2010, Sherwood McGowan wrote: Anyway, let me point out that the CONTEXT has nothing to do with 'access' to a variable...if a call (channel) causes a variable to be assigned a value, then that calland possibly it's 'children' if inheritance is set up. It doesntmatter what context the call ends up being routed to, it will ALWAYs have acces to that variable unless it wascreated as a LOCAL variable in a macro Now, I knew the OP said context, but context does not matter, asterisk looks to see which CHANNEL has access to a variable's instanceI'll behappy tofurther expound upon thiswhen I get back to mylaptop Without clarification from the OP as to whether he meant context (indicating he doesn't understand the scope of a channel variable) or meant channel (indicating he may have had as much to drink as yourself) further discussion is pointless :) -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _ -- 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
Re: [asterisk-users] setting variable for a DID number
Hey Steve, I'm not drunk. I was attempting to keep some levity in my posts because I was pretty frickin irate at the time of several posts that night. Or, maybe I AM drunk, and I can still remember all sorts of nifty Asterisk dialplan and related administration stuff while plastered Or, it's the third option, which involves heavy bouts with insomnia over the last monthit's 5 AM here in StLouis MOSlainte!:D Sent from my iPhone On Aug 20, 2010, at 4:33 AM, Steve Edwards asterisk@sedwards.com wrote: On Thu, 19 Aug 2010, Tino wrote: But when i call my DID number following dialplans are being executed. What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. On Fri, 20 Aug 2010, Sherwood McGowan wrote: Anyway, let me point out that the CONTEXT has nothing to do with 'access' to a variable...if a call (channel) causes a variable to be assigned a value, then that calland possibly it's 'children' if inheritance is set up. It doesntmatter what context the call ends up being routed to, it will ALWAYs have acces to that variable unless it wascreated as a LOCAL variable in a macro Now, I knew the OP said context, but context does not matter, asterisk looks to see which CHANNEL has access to a variable's instanceI'll behappy tofurther expound upon thiswhen I get back to mylaptop Without clarification from the OP as to whether he meant context (indicating he doesn't understand the scope of a channel variable) or meant channel (indicating he may have had as much to drink as yourself) further discussion is pointless :) -- Thanks in advance, --- -- Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _ -- 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 -- _ -- 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
[asterisk-users] setting variable for a DID number
Hello, Is it possible to set a variable in dialpan when the someone calls a particular DID number so that i can use that variable for calls coming to that number only. -- _ -- 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
Re: [asterisk-users] setting variable for a DID number
From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Tino Subject: [asterisk-users] setting variable for a DID number Hello, Is it possible to set a variable in dialpan when the someone calls a particular DID number so that i can use that variable for calls coming to that number only. As you asked the question: Exten = 5551212,1,Set(GLOBAL(TINO)=tino) Will set a variable to be used by any call when the user dials 5551212. If your incoming number is 5551212, you would want to use ex-girlfriend logic like this Exten = _X/5551212,n,Set(GLOBAL(TINO)=tino) Sets TINO when incoming line 5551212 rings. That's it for now. -- _ -- 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
Re: [asterisk-users] setting variable for a DID number
But when i call my DID number following dialplans are being executed. What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. - NoOp(SIP/5070-5407, Received incoming SIP connection from unknown peer to DID NUMBER) in new stack -- Executing [DID NUMBER@from-sip-external:2] Set(SIP/5070-5407, DID=DID NUMBER) in new stack -- Executing [DID NUMBER@from-sip-external:3] Goto(SIP/5070-5407, s|1) in new stack -- Goto (from-sip-external,s,1) -- Executing [...@from-sip-external:1] GotoIf(SIP/5070-5407, 1?checklang:noanonymous) in new stack -- Goto (from-sip-external,s,2) -- Executing [...@from-sip-external:2] GotoIf(SIP/5070-5407, 0?setlanguage:from-trunk|DID NUMBER|1) in new stack -- Goto (from-trunk,DID NUMBER,1) -- Executing [DID NUMBER@from-trunk:1] Set(SIP/5070-5407, __FROM_DID=DID NUMBER) in new stack -- Executing [DID NUMBER@from-trunk:2] Gosub(SIP/5070-5407, app-blacklist-check|s|1) in new stack -- Executing [...@app-blacklist-check:1] LookupBlacklist(SIP/5070-5407, ) in new stack -- Executing [...@app-blacklist-check:2] GotoIf(SIP/5070-5407, 0?blacklisted) in new stack -- Executing [...@app-blacklist-check:3] Set(SIP/5070-5407, CALLED_BLACKLIST=1) in new stack -- Executing [...@app-blacklist-check:4] Return(SIP/5070-5407, ) in new stack -- Executing [DID NUMBER@from-trunk:3] ExecIf(SIP/5070-5407, 0 |Set|CALLERID(name)=Anonymous) in new stack -- Executing [DID NUMBER@from-trunk:4] Set(SIP/5070-5407, __CALLINGPRES_SV=allowed_not_screened) in new stack -- Executing [DID NUMBER@from-trunk:5] SetCallerPres(SIP/5070-5407, allowed_not_screened) P.S : used DID NUMBER in place of actual DID number -- _ -- 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
Re: [asterisk-users] setting variable for a DID number
On Thu, 19 Aug 2010, Tino wrote: But when i call my DID number following dialplans are being executed. What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. exten = _x.,n, set(FOO=XXX) exten = _x.,n, execif($[${ANI} = 551212],set,FOO=YYY}) -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000-- _ -- 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
Re: [asterisk-users] setting variable for a DID number
On Thu, Aug 19, 2010 at 11:01 PM, Steve Edwards asterisk@sedwards.com wrote: On Thu, 19 Aug 2010, Tino wrote: But when i call my DID number following dialplans are being executed. What i need is to set a variable with one value for one DID number and set the same variable with another value for another DID number. Also any contexts should be able to use this variable. exten = _x.,n, set(FOO=XXX) exten = _x.,n, execif($[${ANI} = 551212],set,FOO=YYY}) -- Thanks in advance, - Steve Edwards sedwa...@sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _ -- 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 Oh boy...Ok, first, let's get into the root issue here...First, when a variable is set during a call, unless it's defined as a GLOBAL variable, it is only accessible to THE CHANNEL THAT EXECUTED THE SET COMMAND THAT CAUSED THE VARIABLE TO EXIST. Of course, you can make it available to child channels that are spawned by the original channel by prepending the variable name in the Set() command with one or more underscoresSee the following Voip-Info.org link for more information regarding channels and variable inheritancehttp://www.voip-info.org/wiki/view/Asterisk+variables#InheritanceofChannelVariables If you really need an example of how this works and why variables are specific to the call they're related to, I'll gladly write one up when I return from the pub in the wee hours of the morning...if you're nice... I'll give you a great real world hint/example If I was playing a quick round of Doom at a gaming cafe where all the terminals were thin clients, and all the code to make the game happen was being executed on the application server, my game would not suddenly jump back to the first level when you told the application server you wanted to play Doom as wellNow, envision the application server as your Asterisk server, and our respective games as calls coming into that Asterisk server.. Getting a candle? Possibly a torch? Maybemaybea light bulb? Let me know, I'll gladly elucidate further if need be, but be aware that it will be after a solid round or five of the Slainte Sherwood Mother-F'ing McGowan Because I'm the Mickand I'm awesome P.S. a Sixpack of your choosing to the first person who can correctly identify the person or character the last line of that signature was parodying -- _ -- 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