Hi, At my house, I have two POTS lines. Both are connected to my * server on a TDM400P card. As an example, say the phone numbers are (919)555-1212 and (919)555-1213. I also have four SIP extensions, an ATA with a fax machine, and a DID coming in from an ITSP. I have an autoattendant configured that talks and allows users to forward to the extension they choose, but my family doesn't like it. I figured out how to make the fax work from any extension. How would I make entries in extensions.conf to forward to certain SIP extensions based on the incoming call's DID? I looked all over the web and couldn't find an example of this. I pasted the autoattendant portion of my extensions.conf below. I believe I need to replace the s extension with the DID somehow, but I can't figure out how to go about it. Thanks in advance for your help!!! John --- [mainmenu] include => default exten => s,1,Answer exten => s,2,Background(/var/lib/asterisk/sounds/initial_greeting) exten => 5,1,Directory(default) exten => fax,1,Dial(SIP/6204,20) exten => t,1,Goto(mainmenu,s,1) exten => i,1,Playback(invalid)
On Wed, 11 Aug 2004 12:47:33 -0400, John Blackman <jblackman1@nc.rr.com> wrote:> How would I make entries in extensions.conf to forward to certain SIP > extensions based on the incoming call's DID?In your sip.conf, each DID probably has its own [section] either type=friend or type=user and peer. Within this [section] you define the context=mainmenu for example. We can tell each of these DIDs to go to a different context within our dialplan. At this point we can then make each line do something different, such as ring a different phone. We could have one general purpose number to go to the autoattendent, and the other lines could ring a phone directly. I do this within' my iax.conf, but it should be similar for your sip.conf. You'll just have to look at either sip.conf samples, or perhaps it'll seem self evident once you look at your own sip.conf. Anyways, here's what I do for two incoming DIDs from a VoIP provider. /etc/asterisk/iax.conf [7830] type=friend host=asterisk username=iax-user1 secret=password1 context=mainmenu trunk=yes disallow=all allow=ulaw [7831] type=friend host=asterisk username=iax-user2 secret=password2 context=7831-incoming trunk=yes Then within your extensions.conf, you could do something like this... /etc/asterisk/extensions.conf [mainmenu] ;include => default (*btw: you probably shouldn't do this*) exten => s,1,Answer exten => s,2,Background(/var/lib/asterisk/sounds/initial_greeting) exten => 5,1,Directory(default) exten => fax,1,Dial(SIP/6204,20) exten => t,1,Goto(mainmenu,s,1) exten => i,1,Playback(invalid) [7831-incoming] exten => s,1,Answer exten => s,2,Dial(SIP/100) exten => s,3,Voicemail(u100) exten => s,4,Hangup exten => s,103,Voicemail(b100) exten => s,104,Hangup Hope this helps, Leif Madsen. http://www.asteriskdocs.org
Leif, Thanks for your response!! I kept researching and I found a partial solution. I ended up changing my autoattendant section so it looks like this: [mainmenu] ;include => default (*btw: you probably shouldn't do this*) exten => 5551212,1,Dial(SIP/6201,20) exten => 5551213,1,Dial(SIP/6203,20) exten => s,1,Answer exten => s,2,Background(/var/lib/asterisk/sounds/initial_greeting) exten => 5,1,Directory(default) exten => fax,1,Dial(SIP/6204,20) exten => t,1,Goto(mainmenu,s,1) exten => i,1,Playback(invalid) This causes calls that come in via IAX to get forwarded the way I want them to, but it does not cause calls on the physical zap interfaces to get forwarded to the SIP extensions (they still go to the autoattendant). I was looking on the wiki and it said check the debug files to find out how many digits are passing from the phone company. I did an asterisk -vvvvvvr and I can't see the digits on any interface. I discovered how to make the IAX part work by just trying 4, 7, 10, and 11 digits until I figured out how it works. The DID portion also works now, since I made changes based on your response. The only portion that is lacking is having the zap interfaces work. I have two phone lines at home, but I can't afford to have the phone company upgrade them to a trunk group. I would like to have my wife's number go to her SIP phone and my number go to my SIP phone. I believe I may need to make changes in zapata.conf to do what I want. I read the stuff on the wiki, but I can't understand it enough to figure out how to configure zapata.conf. I think I need to put my zap/3-1 and zap/4-1 into separate contexts for inbound calls, but I also want to leave them in g1 for outbound calls. I see the mention of separate contexts within zapata.conf, but I can't find an example anywhere. I would just experiment to figure it out, but my wife screams if I take her phone out of service and I expect this could take me days to figure out. :-) Best Regards, John