[general]
context=default
bindport=5061
bindaddr=0.0.0.0
srvlookup=yes
tos=lowdelay
maxexpirey=3600
defaultexpirey=600
disallow=all
allow=ilbc,alaw,ulaw,g729,gsm,slinear
language=de
externhost=my.homeip.com
localnet=192.168.1.0/255.255.255.0
nat=yes
register => 123456:[email protected]/123456
[bla_callback]
type=friend
username=123456
secret=password
host=sip.provider.com
fromuser=0721123456
fromdomain=sip.provider.com
context=callback-in
canreinvite=no
qualify=yes
insecure=very
[general]
static=yes
writeprotect=yes
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[globals]
[callback-in]
exten => 123456,1,GotoIf($[${CALLERIDNUM} = Anonymous]?callback-withoutcallid,s,1:callback-withcallid,s,1)
[callback-withoutcallid]
exten => s,1,Set(LANGUAGE()=de)
exten => s,2,Answer
exten => s,3,Wait,1
; EingabeSchleife zur Zieleingabe
exten => s,4,Set(MYNR=)
exten => s,5,Background(privacy-prompt)
exten => s,6,Set(TIMEOUT(response)=10)
exten => s,7,WaitExten
exten => _X,1,Set(MYNR=${MYNR}${EXTEN})
exten => _X,2,Goto(s,6)
; Zuruecksetzen
exten => *,1,Goto(s,4)
; Eigene Rufnummer uebergeben
exten => #,1,Background(queue-thankyou)
exten => #,2,SetCallerID(${MYNR})
exten => #,3,AGI(callback.agi)
exten => #,4,Hangup
; Handling fuer Timeout & bye
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
[callback-withcallid]
exten => s,1,AGI(callback.agi)
exten => s,2,Hangup
;;;;;;;;;;;
[callback-dial]
exten => _X.,1,Dial(SIP/${EXTEN}@bla_callback,,)
[callback-go]
exten => s,1,Answer
exten => s,2,SetLanguage(de)
exten => s,3,Wait,1
; Soll ein Passwort abgefragt werden?
exten => s,4,GotoIf($[${ask4pass} = true]?4:7)
; Erstmal Passwort ueberpruefen
exten => s,5,DigitTimeout(5)
exten => s,6,Set(TIMEOUT(response)=10)
exten => s,7,Authenticate(${password})
; EingabeSchleife zur Zieleingabe
exten => s,8,SetVar(NR=)
exten => s,9,Background(vm-enter-num-to-call)
exten => s,10,Set(TIMEOUT(response)=10)
exten => s,11,WaitExten
exten => _X,1,SetVar(NR=${NR}${EXTEN})
exten => _X,2,Goto(s,9)
; Zuruecksetzen
exten => *,1,Goto(s,8)
; Nummer uebergeben
exten => #,1,Dial(SIP/${NR}@bla_callback,,)
exten => #,2,Goto(#-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
; DialingStates
exten => #-NOANSWER,1,Playback(vm-nobodyavail)
exten => #-NOANSWER,2,Goto(s,8)
exten => #-BUSY,1,Playback(tt-allbusy)
exten => #-BUSY,2,Goto(#,1)
exten => #-CHANUNAVAIL,1,Playback(tt-somethingwrong)
exten => #-CHANUNAVAIL,2,Goto(t,1)
exten => #-CONGESTION,1,Playback(vm-nobodyavail)
exten => #-CONGESTION,2,Goto(s,8)
exten => _#-.,1,Goto(t,1)
; Handling fuer Timeout & bye
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
Channel: Local/06132654321@callback-dial
Callerid: 06132654321
Context: callback-go
Extension: s
MaxRetries: 2
RetryTime: 10
SetVar: ask4pass=false
SetVar: password=noPass
Asterisk Ready.
*CLI> -- Attempting call on Local/06132654321@callback-dial for s@callback-go:1 (Retry 2)
-- Executing Dial("Local/06132654321@callback-dial-69c6,2", "SIP/06132654321@bla_callback||") in new stack
-- Called 06132654321@bla_callback
-- SIP/bla_callback-0fe5 is making progress passing it to Local/06132654321@callback-dial-69c6,2
-- SIP/bla_callback-0fe5 is ringing
-- SIP/bla_callback-0fe5 answered Local/06132654321@callback-dial-69c6,2
> Channel Local/06132654321@callback-dial-69c6,1 was answered.
-- Executing Answer("Local/06132654321@callback-dial-69c6,1", "") in new stack
-- Executing SetLanguage("Local/06132654321@callback-dial-69c6,1", "de") in new stack
-- Executing Wait("Local/06132654321@callback-dial-69c6,1", "1") in new stack
-- Executing GotoIf("Local/06132654321@callback-dial-69c6,1", "0?4:7") in new stack
-- Goto (callback-go,s,7)
-- Executing Authenticate("Local/06132654321@callback-dial-69c6,1", "noPass") in new stack
-- Playing 'agent-pass' (language 'de')
Aug 16 14:40:05 NOTICE[10904]: channel.c:1347 ast_read: Dropping incompatible voice frame on SIP/bla_callback-0fe5 of format slin since our native format has changed to alaw
== Spawn extension (callback-dial, 06132654321, 1) exited non-zero on 'Local/06132654321@callback-dial-69c6,2'
Speicherzugriffsfehler
[custom-dialthrough]
; wait 15 seconds for the user to dial an extension
; Call wird weiterverbunden auf die eingegebene Nummer
exten => s,1,Answer( )
exten => s,2,Authenticate(0000) ; PIN-Nummer eingeben
;exten => s,3,Playback(pin-number-accepted)
exten => s,3,NoOp(--------PIN-Nr ok)
exten => s,4,Set(NR=)
exten => s,5,Playback(vm-enter-num-to-call)
exten => s,6,Set(TIMEOUT(response)=5)
exten => s,7,WaitExten
exten => _X,1,Set(NR=${NR}${EXTEN})
exten => _X,2,NoOp(--------Nummer bis jetzt ${NR})
exten => _X,3,Goto(s,6)
exten => t,1,NoOp(Gewaehlt wird die Nummer ------------------------------------ ${NR})
exten => t,2,Background(deutsch/sounds_de/vm-num-i-have); die mir vorliegende Nummer lautet
exten => t,3,SayDigits(${NR})
exten => t,4,Playback(deutsch/sounds_de/transfer) ; ich verbinde
exten => t,5,wait(1)
exten => t,6,set(OUT_3=SIP/1und1); manuell den Trunk setzen
exten => t,7,set(EXTEN=${NR}) ; wichtig, damit ich jetzt die Nummer pruefen kann
; Im Least Cost Routing habe ich es für dialout-trunk so eingestellt, dass
; in Trunk 1 der Least Cost Router angeworfen wird
; in Trunk 3 der 1und1 Flatrate angeworfen wird
;Eine grobe Least-Cost-Routing-Variante
; alle Auslandsgesprhe ueber Trunk 3 1und1
exten => _00.,1,Macro(dialout-trunk,3,${EXTEN},,)
exten => _00.,2,Goto(#-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
; alle Handies ueber Trunk 1 ISDN
; dialout-trunk wirft bei mir über Trunk 1 automatisch das Least-Cost Routing an
exten => _015.,1,Macro(dialout-trunk,1,${EXTEN},,)
exten => _015.,2,Goto(#-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => _016.,1,Macro(dialout-trunk,1,${EXTEN},,)
exten => _016.,2,Goto(#-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => _017.,1,Macro(dialout-trunk,1,${EXTEN},,)
exten => _017.,2,Goto(#-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
; Rest 1und1 Flat
exten => _0[2-9].,1,Macro(dialout-trunk,3,${EXTEN},,)
exten => _0[2-9].,2,Goto(#-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
;Weitere Nummern könnte man noch anfuegen
; DialingStates
exten => #-NOANSWER,1,Playback(vm-nobodyavail)
exten => #-NOANSWER,2,Goto(s,7)
exten => #-BUSY,1,Playback(tt-allbusy)
exten => #-BUSY,2,Goto(#,1)
exten => #-CHANUNAVAIL,1,Playback(deutsch/sounds_de/privacy-incorrect)
exten => #-CHANUNAVAIL,2,Goto(t,1)
exten => #-CONGESTION,1,Playback(vm-nobodyavail)
exten => #-CONGESTION,2,Goto(s,7)
[callback-dial]
;Jetzt noch ein grobe Least-Cost-Routing-Variante
; alle Auslandsgespraeche ueber Trunk 1 ISDN
; dialout-trunk wirft bei mir über Trunk 1 automatisch das Least-Cost Routing an
exten => _00.,1,Macro(dialout-trunk,3,${EXTEN},,)
; alle Handies ueber Trunk 1 ISDN
exten => _015.,1,Macro(dialout-trunk,1,${EXTEN},,)
exten => _016.,1,Macro(dialout-trunk,1,${EXTEN},,)
exten => _017.,1,Macro(dialout-trunk,1,${EXTEN},,)
; Rest 1und1 Flat
exten => _0[2-9].,1,Macro(dialout-trunk,3,${EXTEN},,)
[macro-dialout-trunk]
exten => s,1,GotoIf($["${ARG3}" = ""]?3:2) ; arg3 is pattern password
exten => s,2,Authenticate(${ARG3})
exten => s,3,Macro(user-callerid)
exten => s,4,Macro(record-enable,${CALLERID(number)},OUT)
exten => s,5,Macro(outbound-callerid,${ARG1})
exten => s,6,Set(GROUP()=OUT_${ARG1})
exten => s,7,GotoIf($[ ${GROUP_COUNT()} > ${OUTMAXCHANS_${ARG1}} ]?108)
; if we've used up the max channels, continue at (n+101)
exten => s,8,Set(DIAL_NUMBER=${ARG2})
exten => s,9,Set(DIAL_TRUNK=${ARG1})
exten => s,10,AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk
exten => s,11,Set(OUTNUM=${OUTPREFIX_${ARG1}}${DIAL_NUMBER}) ; OUTNUM is the final dial number
exten => s,12,Set(custom=${CUT(OUT_${ARG1},:,1)}) ; Custom trunks are prefixed with "AMP:"
exten => s,13,GotoIf($["${custom}" = "AMP"]?20)
;Modifikation PST, Wenn Trunk = 3 = 1und1 ist
exten => s,14,GotoIf($["${ARG1}" = "2"]?40) ; Wenn Trunk=2 (Sipgate) dann normal ueber SIP Sipgate waehlen
exten => s,15,GotoIf($["${ARG1}" = "3"]?30) ; Wenn Trunk=3 (1und1) dann normal ueber SIP Flatrate waehlen
;exten => s,14,Dial(${OUT_${ARG1}}/${OUTNUM},120,${TRUNK_OPTIONS}) ; Regular Trunk Dial
exten => s,16,Macro(tsblcr,${OUTNUM},/etc/asterisk/lcr/tsblcr.routing,${AMPUSER},${AMPUSERCIDNAME},ZAP/g0,/etc/asterisk/sip_additional.conf)
exten => s,17,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/[email protected]:XXXX"
exten => s,20,Set(pre_num=${CUT(OUT_${ARG1},$,1)})
exten => s,21,Set(the_num=${CUT(OUT_${ARG1},$,2)}) ; this is where we expect to find string OUTNUM
exten => s,22,Set(post_num=${CUT(OUT_${ARG1},$,3)})
exten => s,23,GotoIf($["${the_num}" = "OUTNUM"]?24:25) ; if we didn't find "OUTNUM", then skip to Dial
exten => s,24,Set(the_num=${OUTNUM}) ; replace "OUTNUM" with the actual number to dial
;exten => s,21,Dial(${pre_num:4}${the_num}${post_num},120,${TRUNK_OPTIONS})
exten => s,25,Macro(tsblcr,${OUTNUM},/etc/asterisk/lcr/tsblcr.routing,${AMPUSER},${AMPUSERCIDNAME},ZAP/g0,/etc/asterisk/sip_additional.conf)
exten => s,26,Goto(s-${DIALSTATUS},1)
;Normal ueber 1und1 waehlen, nicht per least cost routing
exten => s,30,Noop(Wir waehlen jetzt Ueber die 1&1 Flatrate---------------------------------------------)
exten => s,31,Dial(SIP/1und1/${OUTNUM},120,${TRUNK_OPTIONS}) ; Regular Trunk Dial; manuell SIP/1und1 sonst geht Callback nicht
exten => s,32,Goto(s-${DIALSTATUS},1)
;Ueber Sipgate waehlen, nicht per least cost routing
exten => s,40,Noop(Wir waehlen jetzt Ueber die 1&1 Flatrate---------------------------------------------)
exten => s,41,Dial(${OUT_${ARG1}}/${OUTNUM},120,${TRUNK_OPTIONS}) ; Regular Trunk Dial
exten => s,42,Goto(s-${DIALSTATUS},1)
Nov 19 23:03:16 WARNING[20980] ast_expr2.fl: ast_yyerror(): syntax error: syntax error, unexpected TOK_PLUS, expecting TOK_MINUS or TOK_COMPL or TOK_LP or TOKEN; Input:
+49175XXXXXXX = Anonymous
^
Nov 19 23:03:16 WARNING[20980] ast_expr2.fl: If you have questions, please refer to doc/README.variables in the asterisk source.
Nov 19 23:03:36 WARNING[21006] pbx.c: Timeout, but no rule 't' in context 'callback-dial'
Nov 19 23:03:36 NOTICE[21004] pbx_spool.c: Call failed to go through, reason 1
Nov 19 23:05:02 NOTICE[21037] chan_local.c: No such extension/context anonymous@callback-dial creating local channel
Nov 19 23:05:02 NOTICE[21037] channel.c: Unable to request channel Local/anonymous@callback-dial
Nov 19 23:05:02 NOTICE[21037] pbx_spool.c: Call failed to go through, reason 0
und die Wahl wird nicht angenommen, obwohl ich nur G.711 zulasse und der Channel auch alaw zeigt.WARNING[13234]: channel.c:2341 set_format: Unable to find a codec translation path from ilbc to alaw
WARNING[13234]: channel.c:2341 set_format: Unable to find a codec translation path from ilbc to gsm
CLI>
-- Executing GotoIf("SIP/498142xxxxxx-40908db8", "1?callback-withoutcallid|s|1:callback-withcallid|s|1") in new stack
-- Goto (callback-withoutcallid,s,1)
-- Executing Set("SIP/4981424xxxxxxx-40908db8", "LANGUAGE()=de") in new stack
-- Executing Answer("SIP/498142xxxxxx-40908db8", "") in new stack
-- Executing Wait("SIP/498142xxxxxx-40908db8", "1") in new stack
-- Executing Set("SIP/498142xxxxxx-40908db8", "MYNR=") in new stack
-- Executing BackGround("SIP/498142xxxxx-40908db8", "privacy-prompt") in new stack
-- Playing 'privacy-prompt' (language 'de')
-- Executing Set("SIP/498142xxxxxx-40908db8", "TIMEOUT(response)=10") in new stack
-- Response timeout set to 10
-- Executing WaitExten("SIP/498142xxxxxx-40908db8", "") in new stack
-- Timeout on SIP/498142xxxxxx-40908db8, going to 't'
-- Executing Playback("SIP/498142xxxxxx-40908db8", "vm-goodbye") in new stack
-- Playing 'vm-goodbye' (language 'de')
-- Executing Hangup("SIP/498142xxxxx-40908db8", "") in new stack
== Spawn extension (callback-withoutcallid, t, 2) exited non-zero on 'SIP/498142xxxxx-40908db8'
Um DTMF per Betamax zu uebertragen, benutze ich inband UND alaw (ulaw geht auch). Sobald aber das eine oder andere nicht merh zutrifft, funktioniert DTMF nicht. Sprich ein anderer dtmfmode als inband und alaw - geht nicht. Inband und anderer codec als alaw - geht nicht.merkc schrieb:Bei Sparvoip: tote Hose. Keine Nachricht, kein Congestion, kein Hangup, und es wird auch kein DTMF Ton entgegen genommen. Von inband über auto über rfc2833 alles ausprobiert. Codecs ulaw, alaw, gsm und 729 ausprobiert. immer das selbe.
[general]
static=yes
writeprotect=yes
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[globals]
[callback-in]
exten => 49351<xxx>,1,GotoIf($[${CALLERIDNUM} = Anonymous]?callback-withoutcallid,s,1:callback-withcallid,s,1)
[callback-withoutcallid]
;exten => s,1,Set(LANGUAGE()=de)
;exten => s,2,Answer
;exten => s,3,Wait,1
; EingabeSchleife zur Zieleingabe
;exten => s,4,Set(MYNR=)
;exten => s,5,Background(privacy-prompt)
;exten => s,6,Set(TIMEOUT(response)=10)
;exten => s,7,WaitExten
;exten => _X,1,Set(MYNR=${MYNR}${EXTEN})
;exten => _X,2,Goto(s,6)
; Zuruecksetzen
;exten => *,1,Goto(s,4)
; Eigene Rufnummer uebergeben
;exten => #,1,Background(queue-thankyou)
;exten => #,2,SetCallerID(${MYNR})
;exten => #,3,AGI(callback.agi)
;exten => #,4,Hangup
; Handling fuer Timeout & bye
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
[callback-withcallid]
exten => s,1,AGI(callback.agi)
exten => s,2,Hangup
;;;;;;;;;;;
[callback-dial]
exten => _X.,1,Dial(SIP/${EXTEN}@1und1_callback,,)
[callback-go]
exten => s,1,Set(LANGUAGE()=de)
exten => s,2,Wait,1
; Soll ein Passwort abgefragt werden?
exten => s,3,GotoIf($[${ask4pass} = true]?4:7)
; Erstmal Passwort ueberpruefen
exten => s,4,DigitTimeout(5)
exten => s,5,Set(TIMEOUT(response)=10)
exten => s,6,Authenticate(${password})
; EingabeSchleife zur Zieleingabe
exten => s,7,Set(NR=)
exten => s,8,Background(vm-enter-num-to-call)
exten => s,9,Set(TIMEOUT(response)=10)
exten => s,10,WaitExten
exten => _X,1,Set(NR=${NR}${EXTEN})
exten => _X,2,Goto(s,9)
; Zuruecksetzen
exten => *,1,Goto(s,7)
; Nummer uebergeben und checken, ob erlaubt
exten => #,1,Macro(checkallowed,${NR})
exten => #,2,Dial(SIP/${NR}@1und1_callback,,)
exten => #,3,Goto(#-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
; DialingStates
exten => #-NOANSWER,1,Playback(vm-nobodyavail)
exten => #-NOANSWER,2,Goto(s,7)
exten => #-BUSY,1,Playback(tt-allbusy)
exten => #-BUSY,2,Goto(#,1)
exten => #-CHANUNAVAIL,1,Playback(tt-somethingwrong)
exten => #-CHANUNAVAIL,2,Goto(t,1)
exten => #-CONGESTION,1,Playback(vm-nobodyavail)
exten => #-CONGESTION,2,Goto(s,7)
exten => _#-.,1,Goto(t,1)
; Handling fuer Timeout & bye
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
; Nicht erlaubt abspielen
[macro-notallowed]
exten => c,1,Answer
exten => c,2,Wait(1)
exten => c,3,Playback(ss-noservice)
exten => c,4,Goto(s,7)
exten => c,5,Hangup
; Nicht erlaubte Nummern bei Callback
[macro-checkallowed]
exten => c,1,GotoIf($[${ARG1:0:3} = 019]?50)
exten => c,2,GotoIf($[${ARG1:0:4} = 0900]?50)
exten => c,3,GotoIf($[${ARG1:0:3} = 015]?50)
exten => c,4,GotoIf($[${ARG1:0:3} = 016]?50)
exten => c,5,GotoIf($[${ARG1:0:3} = 017]?50)
exten => c,6,GotoIf($[${ARG1:0:3} = 018]?50)
exten => c,7,GotoIf($[${ARG1:0:3} = 010]?50)
exten => c,8,GotoIf($[${ARG1:0:4} = 0088]?50)
exten => c,9,GotoIf($[${ARG1:0:2} = 00]?50)
exten => c,10,GotoIf($[${ARG1:0:2} = 11]?50)
exten => c,11,GotoIf($[${ARG1:0:4} = 0700]?50)
exten => c,12,GotoIf($[${ARG1:0:4} = 0137]?50)
exten => c,13,GotoIf($[${ARG1:0:4} = 0138]?50)
exten => c,14,GotoIf($[${ARG1:0:3} = 032]?50)
exten => c,50,Macro(notallowed);
exten => 49351<xxx>_XX.,1,Goto(callback-withcallid,s,1)
exten => 49351<xxx>,1,Hangup
exten => #,1,Macro(checkallowed,${NR})
exten => #,1,Macro(checkallowed,c,1)