[Asterisk-Users] Re: Asterisk with iptel.org
Sebastian Milioto
smilioto at gmail.com
Thu Sep 22 10:29:36 MST 2005
With sip show registry I can see I my asterisk is registered:
Host: iptel.org:5060
Username:84565616
Refresh: 145
State: Registered
The following is part of sip.conf:
[general]
port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=g729
allow=alaw
allow=ulaw
context = from-sip
callerid = Unknown
register => 84565616:password_iptel at iptel.org/200 ;iptel register
[200]
username=200
type=friend
secret=otro_password
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=never
mailbox=200 at default
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid="Sebastian" <200>
[iptel]
type=friend
username=84565616
secret=password_iptel
fromdomain=iptel.org
host=iptel.org
And the following is part of extensions.conf
[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-llamadasSIP
[outrt-001-llamadasSIP]
include => outrt-001-llamadasSIP-custom
;;;;;exten => _9.,1,Macro(dialout-trunk,2,${EXTEN:1},00323) before,
this line was uncommented and the following line doesn't existed. But
it doesn't work, so I changed it by the following line
exten => _9.,1,Macro(dialout-SIPiptel,2,${EXTEN:1},00323)
exten => _9.,2,Macro(outisbusy) ; No available circuits
[macro-dialout-SIPiptel]
exten => _9.,1,Dial(SIP/${EXTEN:1}@iptel.org-out,30,r) ;To take the
SIP trunk I dial 9
exten => 200,1,Aswer
exten => 200,3,Hangup
; dialout using a trunk, using pattern matching (don't strip any prefix)
; arg1 = trunk number, arg2 = number, arg3 = route password
[macro-dialout-trunk]
exten => s,1,GotoIf($[foo${ARG3} = foo]?3:2)) ; arg3 is pattern password
exten => s,2,Authenticate(${ARG3})
exten => s,3,Macro(record-enable,${CALLERIDNUM},OUT)
exten => s,4,GotoIf($[foo${ECID${CALLERIDNUM}} = foo]?7) ;check for
CID override for exten
exten => s,5,SetCallerID(${ECID${CALLERIDNUM}})
exten => s,6,Goto(9)
exten => s,7,GotoIf($[foo${OUTCID_${ARG1}} = foo]?9) ;check for CID
override for trunk
exten => s,8,SetCallerID(${OUTCID_${ARG1}})
exten => s,9,SetGroup(OUT_${ARG1})
exten => s,10,CheckGroup(${OUTMAXCHANS_${ARG1}})
; if we've used up the max channels, continue at 109 (n+101)
exten => s,11,SetVar(DIAL_NUMBER=${ARG2})
exten => s,12,SetVar(DIAL_TRUNK=${ARG1})
exten => s,13,AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the
proper dial string for this trunk
exten => s,14,SetVar(OUTNUM=${OUTPREFIX_${ARG1}}${DIAL_NUMBER}) ;
OUTNUM is the final dial number
exten => s,15,Cut(custom=OUT_${ARG1},:,1) ; Custom trunks are
prefixed with "AMP:"
exten => s,16,GotoIf($[${custom} = AMP]?19)
exten => s,17,Dial(${OUT_${ARG1}}/${OUTNUM}) ; Regular Trunk Dial
exten => s,18,Goto(s-${DIALSTATUS},1)
; This is a custom trunk. Substitute $OUTNUM$ with the actual number
and rebuild the dialstring
; example trunks: "AMP:CAPI/XXXXXXXX:b$OUTNUM$,30,r",
"AMP:OH323/$OUTNUM$@XX.XX.XX.XX:XXXX"
exten => s,19,Cut(pre_num=OUT_${ARG1},$,1)
exten => s,20,Cut(the_num=OUT_${ARG1},$,2) ; this is where we expect
to find string OUTNUM
exten => s,21,Cut(post_num=OUT_${ARG1},$,3)
exten => s,22,GotoIf($[${the_num} = OUTNUM]?23:24) ; if we didn't find
"OUTNUM", then skip to Dial
exten => s,23,SetVar(the_num=${OUTNUM}) ; replace "OUTNUM" with the
actual number to dial
exten => s,24,Dial(${pre_num:4}${the_num}${post_num})
exten => s,25,Goto(s-${DIALSTATUS},1)
exten => s,111,Noop(max channels used up)
exten => s-BUSY,1,NoOp(Trunk is reporting BUSY)
exten => s-BUSY,2,Busy()
exten => s-BUSY,3,Wait(60)
exten => s-BUSY,4,NoOp()
Hope you can help me. I'm afraid I make more trouble trying to fix it
Regards,
Sebastian
More information about the asterisk-users
mailing list