James B Holmstedt
2004-Apr-26 09:00 UTC
[Asterisk-Users] Help with connecting 2 servers via iax
I have successfully configured two servers and I am now trying to connect via iax. When I attempt to call from one ext, 2006(server viop1) to extension 3006 (server voip2) I receive a timeout or "call failed 403 forbidden. The information I am receiving from the console is below. Apr 26 10:53:32 WARNING[311313]: channel.c:1745 ast_request: No channel type registered for 'IAX' Apr 26 10:53:32 NOTICE[311313]: app_dial.c:554 dial_exec: Unable to create channel of type 'IAX' Apr 26 10:53:42 WARNING[311313]: pbx.c:1858 ast_pbx_run: Timeout, but no rule 't' in context 'sip' voip1*CLI> Any info would be appreciated. Thanks. My configs are below for sip, iax, and extensions viop1: sip-------------- [general] port = 5060 ; Port to bind to (SIP is 5060) context=sip ;inside_net=192.168.1.15 ;inside_mask=255.255.255.0 ;outside_addr=65.243.233.251 ;externip=65.243.233.251 ;localmask=255.255.255.0 ;localnet=192.168.1.0 bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine) allow=all ;allow=all allow=ulaw ; Allow all codecs allow=alaw allow=g729 ;context = bogon-calls ; Send SIP callers that we don't know about here [2000] type=friend ; This device takes and makes calls username=2000 ; Username on device secret=homemonkey ; Password for device host=dynamic ; This host is not on the same IP addr every time ;context=from-sip ; Inbound calls from this host go here mailbox=2000 ; Activate the message waiting light if this ; voicemailbox has messages in it dtmfmode=rfc2833 [2001] ; Duplicate of 2000, except with different auth data type=friend username=2001 secret=homemonkey host=dynamic ;context=from-sip mailbox=2001 dtmfmode=rfc2833 [2002] ; Duplicate of 2000, except with different auth data type=friend username=2002 secret=homemonkey host=dynamic ;context=from-sip mailbox=2002 dtmfmode=rfc2833 [2003] ; Duplicate of 2000, except with different auth data type=friend username=2003 secret=homemonkey host=dynamic ;context=from-sip mailbox=2003 dtmfmode=rfc2833 [2004] ; Duplicate of 2000, except with different auth data type=friend username=2004 secret=homemonkey host=dynamic ;context=from-sip mailbox=2004 dtmfmode=rfc2833 [2005] ; Duplicate of 2000, except with different auth data type=friend username=2005 secret=homemonkey host=dynamic ;context=from-sip mailbox=2005 dtmfmode=rfc2833 [2006] ; Duplicate of 2000, except with different auth data type=friend username=2006 secret=homemonkey host=dynamic ;context=default;from-sip;context=from-sip mailbox=2006 dtmfmode=rfc2833 qualify=200 [2007] ; Duplicate of 2000, except with different auth data type=friend username=2007 secret=homemonkey host=dynamic ;context=from-sip mailbox=2007 dtmfmode=rfc2833 IAX------------------------------------------------------------------------------------ [general] port=5036 ;bindaddr=192.168.0.1 ;amaflags=default accountcode=lss0101 bandwidth=low ;allow=all ;allow=g723.1 disallow=lpc10 allow=gsm ;x uncommented to allow gsm ;jitterbuffer=no ;dropcount=3 ;maxjitterbuffer=500 ;maxexccessbuffer=100 ;trunkfreq=20 register => voip1:1945@192.168.1.19:5036 ;x Above is the entry to establish an IAX register (connection) ;x with a remote IAX server, i.e. another Asterisk server. This ;x is not necessary unless this server is dynamic, the IP Address ;x changes. Notice register => name:password@192.168.1.31:5036. ;x This local asterisk is registering with remote asterisk2. ;x Asterisk2 must have an entry in its iax.conf to recognize this ;x server and authenticate it (allow it to pass traffic). ;register => joe@remotehost 5656 ;register => marko torkey@tormenta.linux-support.net tos=lowdelay ;x Below is the entry to allow asterisk2 to connect to asterisk ;x with the IAX protocol. The context is local, allowing asterisk2 ;x to contact, call or use any client or interface within the local ;x context in this server (asterisk) depicted within the dial plan. [voip2] type=friend auth=plaintext;new secret=1945 context=local host=dynamic defaultip=192.168.1.19 ;allow=all;new qualify=yes ;trunk=yes Extensions---------------------------------------------------------------------------------------------------------------------- [local] ignorepat => 9 include => default include => parkedcalls include => trunklocal include => iaxtel700 include => trunktollfree include => iaxprovider include => sip ;x included sip static=yes ; These two lines prevent the command-line interface writeprotect=yes ; from overwriting the config file. Leave them here. ;[bogon-calls] ; ; Take unknown callers that may have found ; our system, and send them to a re-order tone. ; The string "_." matches any dialed sequence, so all ; calls will result in the Congestion tone application ; being called. They'll get bored and hang up eventually. ; exten => _.,1,Congestion [sip] ; ; If the number dialed by the calling party was "2000", then ; Dial the user "2000" via the SIP channel driver. Let the number ; ring for 20 seconds, and if no answer, proceed to priority 2. ; If the number gives a "busy" result, then jump to priority 102 ; exten => 2000,1,Dial(SIP/2000,20) ; ; Priority 2 send the caller to voicemail, and gives the "u"navailable ; message for user 2000, as recorded previously. The only way out ; of voicemail in this instance is to hang up, so we have reached ; the end of our priority list. ; exten => 2000,2,Voicemail(u2000) ; ; If the Dialed number in priority 1 above results in ; a "busy" code, then Dial will jump to 101 + (current priority) ; which in our case will be 101+1=102. This +101 jump is built ; into Asterisk and does not need to be defined. ; exten => 2000,102,Voicemail(b2000) exten => 2000,103,Hangup ; ; Now, what if the number dialed was "2001"? ; exten => 2001,1,Dial(SIP/2001,20) exten => 2001,2,Voicemail(u2001) exten => 2001,102,Voicemail(b2001) exten => 2001,103,Hangup exten => 2002,1,Dial(SIP/2002,20) exten => 2002,2,Voicemail(u2002) exten => 2002,102,Voicemail(b2002) exten => 2002,103,Hangup exten => 2003,1,Dial(SIP/2003,20) exten => 2003,2,Voicemail(u2003) exten => 2003,102,Voicemail(b2003) exten => 2003,103,Hangup exten => 2004,1,Dial(SIP/2004,20) exten => 2004,2,Voicemail(u2004) exten => 2004,102,Voicemail(b2004) exten => 2004,103,Hangup exten => 2005,1,Dial(SIP/2005,20) exten => 2005,2,Voicemail(u2005) exten => 2005,102,Voicemail(b2005) exten => 2005,103,Hangup exten => 2006,1,Dial(SIP/2006,20) exten => 2006,2,Voicemail(u2006) exten => 2006,102,Voicemail(b2006) exten => 2006,103,Hangup exten => 2007,1,Dial(SIP/2007,20) exten => 2007,2,Voicemail(u2007) exten => 2007,102,Voicemail(b2007) exten => 2007,103,Hangup ; ; Define a way so that users can dial a number to reach ; voicemail. Call the VoicemailMain application with the ; number of the caller already passed as a variable, so ; all the user needs to do is type in the password. ; exten => _3XXX,1,Dial(IAX/voip2:1945@192.168.1.19/${EXTEN}@local) exten => 2999,1,VoicemailMain(${CALLERIDNUM}) ***************************************************************************** Viop2 SIP----------------------------------------------------------------- [general] port = 5060 ; Port to bind to (SIP is 5060) context=sip ;inside_net=192.168.1.19 ;inside_mask=255.255.255.0 ;outside_addr=65.243.233.251 ;externip=65.243.233.251 ;localmask=255.255.255.0 ;localnet=192.168.1.0 bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine) allow=all ;allow=ulaw ; Allow all codecs ;allow=alaw ;allow=g729 ;allow=all ;context = bogon-calls ; Send SIP callers that we don't know about here [3000] type=friend ; This device takes and makes calls username=3000 ; Username on device secret=homemonkey ; Password for device host=dynamic ; This host is not on the same IP addr every time context=from-sip ; Inbound calls from this host go here mailbox=3000 ; Activate the message waiting light if this ; voicemailbox has messages in it dtmfmode=rfc2833 [3001] ; Duplicate of 2000, except with different auth data type=friend username=3001 secret=homemonkey host=dynamic context=from-sip mailbox=3001 dtmfmode=rfc2833 [3002] ; Duplicate of 2000, except with different auth data type=friend username=3002 secret=homemonkey host=dynamic context=from-sip mailbox=3002 dtmfmode=rfc2833 [3003] ; Duplicate of 2000, except with different auth data type=friend username=2003 secret=homemonkey host=dynamic context=from-sip mailbox=2003 dtmfmode=rfc2833 [3004] ; Duplicate of 2000, except with different auth data type=friend username=3004 secret=homemonkey host=dynamic context=from-sip mailbox=3004 dtmfmode=rfc2833 [3005] ; Duplicate of 2000, except with different auth data type=friend username=3005 secret=homemonkey host=dynamic context=from-sip mailbox=3005 dtmfmode=rfc2833 [3006] ; Duplicate of 2000, except with different auth data type=friend ;username=3006 ;secret=homemonkey host=dynamic ;context=from-sip mailbox=3006 dtmfmode=rfc2833 qualify=200 [3007] ; Duplicate of 2000, except with different auth data type=friend username=3007 secret=homemonkey host=dynamic context=from-sip mailbox=3007 dtmfmode=rfc2833 [3008] ; Duplicate of 2000, except with different auth data type=friend username=3008 secret=homemonkey host=dynamic context=from-sip mailbox=3008 dtmfmode=rfc2833 IAX-------------------------------------------------------------------------------------------------------------------------- [general] port=5036 ;bindaddr=192.168.0.1 ;amaflags=default accountcode=lss0101 bandwidth=low ;allow=all ;allow=g723.1 disallow=lpc10 allow=gsm ;x uncommented to allow gsm ;jitterbuffer=no ;dropcount=3 ;maxjitterbuffer=500 ;maxexccessbuffer=100 ;trunkfreq=20 register => voip1:1945@192.168.1.15:5036 ;x Above is the entry to establish an IAX register (connection) ;x with a remote IAX server, i.e. another Asterisk server. This ;x is not necessary unless this server is dynamic, the IP Address ;x changes. Notice register => name:password@192.168.1.15:5036 ;x This local asterisk2 is registering with remote asterisk. ;x Asterisk2 must have an entry in its iax.conf to recognize this ;x server and authenticate it (allow it to pass traffic). ;register => joe@remotehost 5656 ;register => marko torkey@tormenta.linux-support.net tos=lowdelay ;x Below is the entry to allow asterisk to connect to asterisk2 ;x with the IAX protocol. The context is local, allowing asterisk ;x to contact, call or use any client or interface within the local ;x context in this server (asterisk2) depicted within the dial plan. [voip1] type=friend auth=plaintext;auth=md5 secret=1945 context=local host=dynamic defaultip=192.168.1.15 ;allow=all;new qualify=yes ;trunk=yes extensions---------------------------------------------------------------------------------------------------------- [local] ignorepat => 9 include => default include => parkedcalls include => trunklocal include => iaxtel700 include => trunktollfree include => iaxprovider include => sip ;x included sip static=yes ; These two lines prevent the command-line interface writeprotect=yes ; from overwriting the config file. Leave them here. ;[bogon-calls] ; ; Take unknown callers that may have found ; our system, and send them to a re-order tone. ; The string "_." matches any dialed sequence, so all ; calls will result in the Congestion tone application ; being called. They'll get bored and hang up eventually. ; exten => _.,1,Congestion [sip] ; ; If the number dialed by the calling party was "2000", then ; Dial the user "2000" via the SIP channel driver. Let the number ; ring for 20 seconds, and if no answer, proceed to priority 2. ; If the number gives a "busy" result, then jump to priority 102 ; exten => 3000,1,Dial(SIP/3000,20) ; ; Priority 2 send the caller to voicemail, and gives the "u"navailable ; message for user 2000, as recorded previously. The only way out ; of voicemail in this instance is to hang up, so we have reached ; the end of our priority list. ; exten => 3000,2,Voicemail(u3000) ; ; If the Dialed number in priority 1 above results in ; a "busy" code, then Dial will jump to 101 + (current priority) ; which in our case will be 101+1=102. This +101 jump is built ; into Asterisk and does not need to be defined. ; exten => 3000,102,Voicemail(b3000) exten => 3000,103,Hangup ; ; Now, what if the number dialed was "3001"? ; exten => 3001,1,Dial(SIP/3001,20) exten => 3001,2,Voicemail(u3001) exten => 3001,102,Voicemail(b3001) exten => 3001,103,Hangup exten => 3002,1,Dial(SIP/3002,20) exten => 3002,2,Voicemail(u3002) exten => 3002,102,Voicemail(b3002) exten => 3002,103,Hangup exten => 3003,1,Dial(SIP/3003,20) exten => 3003,2,Voicemail(u3003) exten => 3003,102,Voicemail(b3003) exten => 3003,103,Hangup exten => 3004,1,Dial(SIP/3004,20) exten => 3004,2,Voicemail(u3004) exten => 3004,102,Voicemail(b3004) exten => 3004,103,Hangup exten => 3005,1,Dial(SIP/3005,20) exten => 3005,2,Voicemail(u3005) exten => 3005,102,Voicemail(b3005) exten => 3005,103,Hangup exten => 3006,1,Dial(SIP/3006,20) exten => 3006,2,Voicemail(u3006) exten => 3006,102,Voicemail(b3006) exten => 3006,103,Hangup exten => 3007,1,Dial(SIP/3007,20) exten => 3007,2,Voicemail(u3007) exten => 3007,102,Voicemail(b3007) exten => 3007,103,Hangup exten => 3008,1,Dial(SIP/3008,20) exten => 3008,2,Voicemail(u3008) exten => 3008,102,Voicemail(b3008) exten => 3008,103,Hangup ; ; Define a way so that users can dial a number to reach ; voicemail. Call the VoicemailMain application with the ; number of the caller already passed as a variable, so ; all the user needs to do is type in the password. ; exten => _2XXX,1,Dial(IAX/voip1:1945@192.168.1.15/${EXTEN}@local) exten => 3999,1,VoicemailMain(${CALLERIDNUM}) _________________________________________________________________ Test your ‘Travel Quotient’ and get the chance to win your dream trip! http://travel.msn.com