[Asterisk-Users] IAX2 and FWD - Wrong context?

Don Fanning donfanning at msn.com
Sat May 14 08:06:25 MST 2005


Here ya go, thanks!

;
; Static extension configuration file, used by
; the pbx_config module. This is where you configure all your 
; inbound and outbound calls in Asterisk. 
; 

;
; The "General" category is for certain variables.  
;
[general]
;
; If static is set to no, or omitted, then the pbx_config will rewrite
; this file when extensions are modified.  Remember that all comments
; made in the file will be lost when that happens. 
;
; XXX Not yet implemented XXX
;
static=yes
;
; if static=yes and writeprotect=no, you can save dialplan by
; CLI command 'save dialplan' too
;
writeprotect=no

; You can include other config files, use the #include command (without the
';')
; Note that this is different from the "include" command that includes
contexts within 
; other contexts. The #include command works in all asterisk configuration
files.
;#include "filename.conf"

; The "Globals" category contains global variables that can be referenced
; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental
variable
; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
;
[globals]
CONSOLE=Console/dsp				; Console interface for demo
;CONSOLE=Zap/1
;CONSOLE=Phone/phone0
CONSOLE=Phone/Phone1
;IAXINFO=guest					; IAXtel username/password
;IAXINFO=myuser:mypass
;TRUNK=Zap/g2					; Trunk interface
;TRUNKMSD=1					; MSD digits to strip
(usually 1 or 0)
;TRUNK=IAX2/user:pass at provider
OUTBOUND=SIP/voipuser ; outbound calls route to www.voipuser.org
DON=SIP/10001 ; Don's Extension
ALAN=SIP/10002 ; Alan's Extension
EVERYONE=${DON}&${ALAN} ; All Extensions

[default]
include => mainmenu

;*************************************************************************
;***************************FWD IAX Parameters****************************
;*************************************************************************
;
FWDNUMBER=xxxxxx ; your calling number
FWDCIDNAME="GCSDP" ; your caller id
FWDPASSWORD=xxxxxxx ; FWD password
FWDRINGS=10003 ; the phone to ring
FWDVMBOX=0 ; the VM box for this user


[trunkint]
;
; International long distance through trunk
;
exten => _00.,1,Dial(${OUTBOUND}/${EXTEN},tT)
exten => _00.,2,Congestion

[trunkld]
;
; Long distance context accessed through trunk
;
exten => _1NXXNXXXXXX,1,Dial(${OUTBOUND}/${EXTEN},tT)
exten => _1NXXNXXXXXX,2,Congestion

[trunklocal]
;
; Local seven-digit dialing accessed through trunk interface
;
exten => _NXXXXXX,1,Dial(${OUTBOUND}/${EXTEN},tT)
exten => _NXXXXXX,2,Congestion

[trunktollfree]
;
; Long distance context accessed through trunk interface
;
exten => _1800NXXXXXX,1,Dial(${OUTBOUND}/${EXTEN},tT)
exten => _1800NXXXXXX,2,Congestion
exten => _1888NXXXXXX,1,Dial(${OUTBOUND}/${EXTEN},tT)
exten => _1888NXXXXXX,2,Congestion
exten => _1877NXXXXXX,1,Dial(${OUTBOUND}/${EXTEN},tT)
exten => _1877NXXXXXX,2,Congestion
exten => _1866NXXXXXX,1,Dial(${OUTBOUND}/${EXTEN},tT)
exten => _1866NXXXXXX,2,Congestion

[international]
;
; Master context for international long distance
;
;ignorepat => 0
;include => longdistance
;include => trunkint

[longdistance]
;
; Master context for long distance
;
;ignorepat => 0
;include => local
;include => trunkld

[outbound]
;
; Master context for local, toll-free, and iaxtel calls only
;
include => default
include => parkedcalls
include => trunklocal
include => trunktollfree
include => emergency
include => pobk_iax
include => fwd-out
include => nexthopproject
include => iaxtel-out

[inboundinternal]
exten => i,1,Playback(invalid)
exten => i,2,Hangup
include => outbound
include => internalextensions
include => voicemail
include => conference
include => sillystuff
include => starsixnine
include => parkedcalls

[fromiaxfwd]
exten => ${FWDNUMBER},1,Dial(${FWDRINGS},20,r)
exten => ${FWDNUMBER},2,Voicemail,u${FWDVMBOX}
exten => ${FWDNUMBER},102,Voicemail,b${FWDVMBOX}

[inbound-from-sip]
;purged to default context
include => default

[inbound-from-iax]
;purged to default context
include => default
;unless they dialed a 10001 extension, in which case
exten => _1000x,1,Goto(internalextensions,${EXTEN},1)
;transfer them to the internalextensions/extensionnumber priority 1
exten => _.,1,Goto(mainmenu,s,1)
exten => _.,2,Hangup

;redundancy
exten => i,1,Goto(mainmenu,s,1)

;invalid extension?
;ok set caller id to 7callerid
exten => i,1,SetCIDNum(7${CALLERIDNUM})
;then goto main menu
exten => i,2,Goto(mainmenu,s,1)
;make sure they hangup
exten => i,3,Hangup

;called anything?
;ok set caller id to 7callerid
exten => _,1,SetCIDNum(7${CALLERIDNUM})
;then goto main menu
exten => _,2,Goto(mainmenu,s,1)
;make sure they hangup
exten => _,3,Hangup

[incoming_voipuser]
exten => 08449864758,1,NoOp(---${CALLERID} calling on VoIPUser (${EXTEN})
---)
exten => 08449864758,2,Dial(SIP/10003,20)
exten => 08449864758,3,Answer
exten => 08449864758,4,Wait,1
exten => 08449864758,5,Voicemail(u1)
exten => 08449864758,6,HangUp

[internalextensions]
;internal extensions obviously, call us using the macro stdexten
exten => 10001,1,Macro(stdexten,10001,${DON})
exten => don,1,Goto(10001|1)
exten => 10002,1,Macro(stdexten,10002,${ALAN})
exten => alan,1,Goto(10002|1)

[nexthopproject]
;some random free american call thing
exten => 1810,1,SetCIDName(${CLIDNAME})
exten => 1810,2,Dial(IAX2/XXXXXX:XXXXXXX at iaxtel.com/17009452475 at iaxtel)

[iaxtel-out]
;make calls to iaxtel via this context

exten => _17XXNXXXXXX,1,Dial(IAX2/jfalcon:falcon at iaxtel.com/${EXTEN}@iaxtel)
exten => _1888NXXXXXX,1,Dial(IAX2/jfalcon:falcon at iaxtel.com/${EXTEN}@iaxtel)
exten => _1877NXXXXXX,1,Dial(IAX2/jfalcon:falcon at iaxtel.com/${EXTEN}@iaxtel)
exten => _1866NXXXXXX,1,Dial(IAX2/jfalcon:falcon at iaxtel.com/${EXTEN}@iaxtel)
exten => _1800NXXXXXX,1,Dial(IAX2/jfalcon:falcon at iaxtel.com/${EXTEN}@iaxtel)

[fwd-out]
;to make calls to fwd, we prefix it with a 7
;set our callerid to FWDNUMBER
exten => _7.,1,SetCallerID(${FWDCIDNAME})
;call it over iax 
exten =>
_7.,2,Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN},60,r)
;make sure it hangs up
exten => _7.,3,Congestion

[voicemail]
exten => 86,1,VoicemailMain
exten => 86,2,Hangup
exten => 1571,1,VoicemailMain
exten => 1571,2,Hangup

[conference]
;conference rooms
exten => 6101,1,meetme,1
exten => 6102,1,meetme,2
exten => 6103,1,meetme,3
exten => 6104,1,meetme,4
exten => 6105,1,meetme,5

[emergency]
;not used since it's voip only

[pobk_iax]
;used to link other asterisk systems
;exten 1919 dials over iax
;
;exten => 1919,1,Dial(IAX2/bordem at londonlink/1919,tT)
;exten => 1919,2,Hangup

[starsixnine]
;repeats last call and redials if you press 3 when it asks you to
exten => *69,1,Answer
exten => *69,2,Wait(1)
exten => *69,3,Dbget(lastcaller=CALLLOG/${CALLERIDNUM})
exten => *69,4,Dbget(month=CALLLOG/${CALLERIDNUM}-month)
exten => *69,5,Dbget(day=CALLLOG/${CALLERIDNUM}-day)
exten => *69,6,Dbget(hour=CALLLOG/${CALLERIDNUM}-hour)
exten => *69,7,Dbget(minute=CALLLOG/${CALLERIDNUM}-minute)
exten => *69,8,Dbget(second=CALLLOG/${CALLERIDNUM}-second)
exten => *69,9,GotoIf($[${month} = ${TIMESTAMP:4:2}]?10:13)
exten => *69,10,GotoIf($[${day} = ${TIMESTAMP:6:2}]?11:13)
exten => *69,11,Wait(1)
exten => *69,12,Goto(66)
exten => *69,13,Wait(1)
exten => *69,14,GotoIf($[${day:0:1} = 0]?15:17)
exten => *69,15,Playback(digits/h-${day:1})
exten => *69,16,Goto(29)
exten => *69,17,GotoIf($[${day:0:1} = 2]?18:83)
exten => *69,18,Playback(20)
exten => *69,19,Playback(digits/h-${day:1})
exten => *69,21,Goto(29)

exten => *69,83,GotoIf($[${day:0:1} = 3]?22:24)

exten => *69,22,Playback(30)
exten => *69,23,Playback(digits/h-${day:1})
exten => *69,24,Goto(29)
exten => *69,25,GotoIf($[${day:0:1}=1]26?:97)
exten => *69,26,Playback(digits/h-${day})
exten => *69,27,Goto(66)
exten => *69,29,Wait(1)
exten => *69,30,GotoIf($[${month}=01]?31:33)
exten => *69,31,Playback(digits/mon-0)
exten => *69,32,Goto(66)
exten => *69,33,GotoIf($[${month}=02]?34:36)
exten => *69,34,Playback(digits/mon-1)
exten => *69,35,Goto(66)
exten => *69,36,GotoIf($[${month}=03]?37:39)
exten => *69,37,Playback(digits/mon-2)
exten => *69,38,Goto(66)
exten => *69,39,GotoIf($[${month}=04]?40:42)
exten => *69,40,Playback(digits/mon-3)
exten => *69,41,Goto(66)
exten => *69,42,GotoIf($[${month}=05]?43:45)
exten => *69,43,Playback(digits/mon-4)
exten => *69,44,Goto(66)
exten => *69,45,GotoIf($[${month}=06]?46:48)
exten => *69,46,Playback(digits/mon-5)
exten => *69,47,Goto(66)
exten => *69,48,GotoIf($[${month}=07]?49:51)
exten => *69,49,Playback(digits/mon-6)
exten => *69,50,Goto(66)
exten => *69,51,GotoIf($[${month}=08]?52:54)
exten => *69,52,Playback(digits/mon-7)
exten => *69,53,Goto(66)
exten => *69,54,GotoIf($[${month}=09]?55:57)
exten => *69,55,Playback(digits/mon-8)
exten => *69,56,Goto(66)
exten => *69,57,GotoIf($[${month}=10]?58:60)
exten => *69,58,Playback(digits/mon-9)
exten => *69,59,Goto(66)
exten => *69,60,GotoIf($[${month}=11]?61:63)
exten => *69,61,Playback(digits/mon-10)
exten => *69,62,Goto(66)
exten => *69,63,GotoIf($[${month}=12]?64:97)
exten => *69,64,Playback(digits/mon-11)
exten => *69,65,Goto(66)
exten => *69,66,Wait(1)
exten => *69,67,SayNumber(${hour})
exten => *69,68,NoOp
exten => *69,69,SayNumber(${minute})
exten => *69,70,Playback(vm-and)
exten => *69,71,Saynumber(${second})
exten => *69,72,Wait(1)
exten => *69,73,GotoIf($[${lastcaller}]?74:76)
exten => *69,74,Wait(1)
exten => *69,75,Goto(78)
exten => *69,76,Playback(privacy-incorrect)
exten => *69,77,Hangup
exten => *69,78,SayDigits(${lastcaller})
exten => *69,79,Background(pressthreetocallback)
exten => *69,80,Timeout(7)
exten => *69,81,NoOp
exten => *69,82,Hangup
exten => *69,97,Playback(tt-somethingwrong)
exten => *69,98,Playback(tt-weasels)
exten => *69,99,Hangup

exten => 3,1,Goto(inboundinternal,${lastcaller},1);
exten => 3,2,Playback(vm-goodbye)
exten => i,2,Hangup
exten => i,1,Playback(vm-goodbye)
exten => i,2,Hangup

[sillystuff]
;
; Create an extension, 500, for dialing the
; Asterisk demo.
;
exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
exten => 500,2,Dial(IAX2/guest at misery.digium.com/s at default)	; Call the
Asterisk demo
exten => 500,3,Playback(demo-nogo)	; Couldn't connect to the demo site
exten => 500,4,Goto(s,6)		; Return to the start over message.

;
; Create an extension, 600, for evaulating echo latency.
;
exten => 600,1,Playback(demo-echotest)	; Let them know what's going on
exten => 600,2,Echo			; Do the echo test
exten => 600,3,Playback(demo-echodone)	; Let them know it's over
exten => 600,4,Goto(s,6)		; Start over

;
; Give voicemail at extension 8500
;
exten => 0,1,VoicemailMain
exten => 0,2,Goto(s,6)
;

; Here's what a phone entry would look like (IXJ for example)
;
;exten => 1265,1,Dial(Phone/phone0,15)
;exten => 1265,2,Goto(s,5)

;123 plays the time
exten => 123,1,Answer
exten => 123,2,SayUnixTime()
exten => 123,3,Hangup

;321 plays a stream
exten => 321,1,Answer
exten => 321,2,MP3Player,http://64.236.34.97:80/stream/1003

;890 plays local music file
exten => 890,1,Answer()
exten => 890,2,Wait,1
exten => 890,3,mp3player(/var/lib/asterisk/music/890_hold.mp3)
exten => 890,4,Goto(890,1)

;503 is a key test
exten => 503,1,Playback(digits/h-1)
exten => 503,2,Wait(1)
exten => 503,3,Playback(digits/mon-1)
exten => 503,4,Wait(1)
exten => 503,5,Playback(digits/oh)
exten => 503,6,Hangup


[macro-stdexten];
exten => s,1,GotoIf($[${ARG1} = 10003]?30:2) ; is it a call for don? if yes
continue if no goto 30

;save all the caller id info (for 1471) in CALLOG/EXTEN
exten => s,2,DBput(CALLLOG/${ARG1}=${CALLERIDNUM})
exten => s,3,DBput(CALLLOG/${ARG1}-month=${TIMESTAMP:4:2})
exten => s,4,DBput(CALLLOG/${ARG1}-day=${TIMESTAMP:6:2})
exten => s,5,DBput(CALLLOG/${ARG1}-hour=${TIMESTAMP:9:2})
exten => s,6,DBput(CALLLOG/${ARG1}-minute=${TIMESTAMP:-4:2})
exten => s,7,DBput(CALLLOG/${ARG1}-second=${TIMESTAMP:-2:2})
;play transfer (please hold while I connect you)
exten => s,8,Playback(transfer)
;Ring ring, call arg2 (but put caller on a Music on hold process)
exten => s,9,Dial(${ARG2},25,m)
;If unavailable, send to voicemail w/ unavail announce
exten => s,10,Voicemail(u${ARG1})
exten => s,11,Hangup()

exten => s,102,Voicemail(b${ARG1})
exten => s,103,Hangup()

;adds callid stuff to everyone's extension
exten => s,30,DBput(CALLLOG/10001=${CALLERIDNUM})
exten => s,31,DBput(CALLLOG/10001-month=${TIMESTAMP:4:2})
exten => s,32,DBput(CALLLOG/10001-day=${TIMESTAMP:6:2})
exten => s,33,DBput(CALLLOG/10001-hour=${TIMESTAMP:9:2})
exten => s,34,DBput(CALLLOG/10001-minute=${TIMESTAMP:-4:2})
exten => s,35,DBput(CALLLOG/10001-second=${TIMESTAMP:-2:2})
exten => s,36,DBput(CALLLOG/10002=${CALLERIDNUM})
exten => s,37,DBput(CALLLOG/10002-month=${TIMESTAMP:4:2})
exten => s,38,DBput(CALLLOG/10002-day=${TIMESTAMP:6:2})
exten => s,39,DBput(CALLLOG/10002-hour=${TIMESTAMP:9:2})
exten => s,40,DBput(CALLLOG/10002-minute=${TIMESTAMP:-4:2})
exten => s,41,DBput(CALLLOG/10002-second=${TIMESTAMP:-2:2})

;goto 8
exten => s,42,Goto(8)


[mainmenu]
;
;the main menu
;
;wait two seconds (to let the 2nd ring come through (for bellcore cid))
exten => s,1,Wait,1
exten => s,2,Wait,2
;answer it
exten => s,3,Answer
;play welcome message
exten => s,4,Background(hello)
;play end message
exten => s,5,Background(end)
;play the short 890 (20 sec)
exten => s,6,Background(890)
;play hello again
exten => s,7,Background(hello)
;play end again
exten => s,8,Background(end)
;play 5 minute 890
exten => s,9,Background(890long)
;wtf are they doing sitting there for 5 minutes
exten => s,10,Background(realend)
;hangup
exten => s,11,Hangup
;press 1 for Don
exten => 1,1,Macro(stdexten,10001,${DON})
exten => don,1,Goto(10001|1)
;press 2 for Alan
exten => 2,1,Macro(stdexten,10002,${ALAN})
exten => alan,1,Goto(10002|1)

Thanks,
Don Fanning
Freelance Hacker - Producer of the 3 M's (Music, Movies and Microcode)
Wherever you go, There you are. - Buckaroo Banzai
 

> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com 
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of 
> Wilson Pickett
> Sent: Saturday, May 14, 2005 1:59 AM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [Asterisk-Users] IAX2 and FWD - Wrong context?
> 
> > I'm setting up asterisk and trying to get IAX2 running for FWD.  I 
> > followed the FWD IAX2 page verbatim but I get the following error.
> > 
> > May 14 08:09:31 WARNING[7569]: chan_iax2.c:5569 socket_read: Call 
> > rejected by 65.39.205.121: No such context/extension
> 
> How about giving us a look at your dial exten ?
> 



More information about the asterisk-users mailing list