I have two DID numbers. I want to configurate my IVR to initiate a context 1 if I dial DID 1. If DID2 is dialed then start with context 2. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091121/da59dd45/attachment.htm
Thomas, Thomas Perron wrote:> I have two DID numbers. I want to configurate my IVR to initiate a > context 1 if I dial DID 1. > If DID2 is dialed then start with context 2.Assuming that the DID originator sends you the number in the Request URI, you can just treat them like "extensions" in Asterisk. Example: if you have DID 6789540670 and 6789540671: exten => 6789540670,1,Goto(context_1,${EXTEN},1) exten => 6789540671,1,Goto(context_2,${EXTEN},1) [context_1] ; IVR exten => 6789540670,1,Answer exten => 6789540670,n,Playback(hello-world) exten => 6789540670,n,Hangup [context_2] exten => 6789540671,1,Dial(SIP/abalashov,30,r) exten => 6789540671,n,Congestion -- Alex -- Alex Balashov - Principal Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671
Hi Alex, Thank you Tom On Sat, Nov 21, 2009 at 10:24 AM, Alex Balashov <abalashov at evaristesys.com>wrote:> Thomas, > > Thomas Perron wrote: > > > I have two DID numbers. I want to configurate my IVR to initiate a > > context 1 if I dial DID 1. > > If DID2 is dialed then start with context 2. > > Assuming that the DID originator sends you the number in the Request > URI, you can just treat them like "extensions" in Asterisk. Example: > if you have DID 6789540670 and 6789540671: > > exten => 6789540670,1,Goto(context_1,${EXTEN},1) > exten => 6789540671,1,Goto(context_2,${EXTEN},1) > > [context_1] > > ; IVR > > exten => 6789540670,1,Answer > exten => 6789540670,n,Playback(hello-world) > exten => 6789540670,n,Hangup > > [context_2] > > exten => 6789540671,1,Dial(SIP/abalashov,30,r) > exten => 6789540671,n,Congestion > > -- Alex > > -- > Alex Balashov - Principal > Evariste Systems > Web : http://www.evaristesys.com/ > Tel : (+1) (678) 954-0670 > Direct : (+1) (678) 954-0671 > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > 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/20091121/d53d63b5/attachment.htm
> Thomas Perron wrote: > >> I have two DID numbers. I want to configurate my IVR to initiate a >> context 1 if I dial DID 1. If DID2 is dialed then start with context 2.If the DIDs are from different providers, you can specify different contexts in [iax|sip].conf. On Sat, 21 Nov 2009, Alex Balashov wrote:> Assuming that the DID originator sends you the number in the Request > URI, you can just treat them like "extensions" in Asterisk. Example: if > you have DID 6789540670 and 6789540671: > > exten => 6789540670,1,Goto(context_1,${EXTEN},1) > exten => 6789540671,1,Goto(context_2,${EXTEN},1)I prefer to save EXTEN (after any pattern matching nonsense) in a more "meaningful" variable like DNIS and then use the "s" extension from then on. I find it "cleaner" and more maintainable. For example (typing off the top of my head): [incoming-from-xyz] exten = _678954067x,1, set(DNIS=${EXTEN}) exten = 6789540670,2, goto(home,s,1) exten = 6789540671,2, goto(work,s,1) [home] exten = s,1, dial(sip/home-phone) [work] exten = s,1, dial(sip/work-phone) If I get another work number, I just add another line to incoming-from-xyz. If I change a number, I just change that single line. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
thanks On Sat, Nov 21, 2009 at 12:26 PM, Steve Edwards <asterisk.org at sedwards.com>wrote:> > Thomas Perron wrote: > > > >> I have two DID numbers. I want to configurate my IVR to initiate a > >> context 1 if I dial DID 1. If DID2 is dialed then start with context 2. > > If the DIDs are from different providers, you can specify different > contexts in [iax|sip].conf. > > On Sat, 21 Nov 2009, Alex Balashov wrote: > > > Assuming that the DID originator sends you the number in the Request > > URI, you can just treat them like "extensions" in Asterisk. Example: if > > you have DID 6789540670 and 6789540671: > > > > exten => 6789540670,1,Goto(context_1,${EXTEN},1) > > exten => 6789540671,1,Goto(context_2,${EXTEN},1) > > I prefer to save EXTEN (after any pattern matching nonsense) in a more > "meaningful" variable like DNIS and then use the "s" extension from then > on. I find it "cleaner" and more maintainable. For example (typing off the > top of my head): > > [incoming-from-xyz] > exten = _678954067x,1, set(DNIS=${EXTEN}) > exten = 6789540670,2, goto(home,s,1) > exten = 6789540671,2, goto(work,s,1) > > [home] > exten = s,1, dial(sip/home-phone) > > [work] > exten = s,1, dial(sip/work-phone) > > If I get another work number, I just add another line to > incoming-from-xyz. If I change a number, I just change that single line. > > -- > Thanks in advance, > ------------------------------------------------------------------------- > Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST > Newline Fax: +1-760-731-3000 > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > 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/20091121/a7ad9888/attachment.htm