[Solved] Bad context?

[EDIT]
I think i fix it

I just dial with the _X. extension, and then start playback etc with the extension s,1.

I get the variable i want using GLOBAL with the local exten. Good or Bad way to do it ?

[quote][appel-sortant]
exten => _X.,1,Set(GLOBAL(LOOP)=0)
exten => _X.,n,Set(GLOBAL(MAX)=3)
exten => _X.,n,Set(GLOBAL(ACCEPT_INTER)=0)
exten => _X.,n,Set(GLOBAL(NEXT)=0)

exten => _X.,n,NoOp(${CHANNEL})

exten => _X.,n,AGI(/var/lib/asterisk/agi-bin/getNext.php,${EXTEN})
exten => _X.,n,NoOp(${NEXT})
exten => _X.,n,Set(GLOBAL(NEXT)=${NEXT})

exten => _X.,n,Dial(SIP/${EXTEN},10,gtr)

exten => s,1,Playback(silence/1)
exten => s,n,AMD()
exten => s,n,NoOp(${NEXT})
exten => s,n,NoOp(${AMDSTATUS})
exten => s,n,GotoIf($[${AMDSTATUS}=MACHINE]?mach:appel-sortant-humn,${EXTEN},1) ;[/quote]

And then, i now got acces to the ${NEXT} and the ${EXTEN} in the s extension because of the global var in _X. extension (my main problèm in another post : viewtopic.php?f=1&t=83862 )


Hi,

I got a problem, but google searchs do nothing interesting.

After the Dial, asterisk CLI does not follow my current extention

I never edit a zapata.conf or dahdi or whatever …

[quote] – <Local/1002@appel-sortant-f1e2;2>AGI Script /var/lib/asterisk/agi-bin/getNext.php completed, returning 0
– Executing [1002@appel-sortant:7] NoOp(“Local/1002@appel-sortant-f1e2;2”, “1003”) in new stack
– Executing [1002@appel-sortant:8] Dial(“Local/1002@appel-sortant-f1e2;2”, “SIP/1002,10,gtr”) in new stack
== Using SIP RTP CoS mark 5
– Called 1002
– SIP/1002-00000005 is ringing
– SIP/1002-00000005 answered Local/1002@appel-sortant-f1e2;2
> Channel Local/1002@appel-sortant-f1e2;1 was answered.
== Starting Local/1002@appel-sortant-f1e2;1 at appel-sortant,s,1 failed so falling back to exten ‘s’
== Starting Local/1002@appel-sortant-f1e2;1 at appel-sortant,s,1 still failed so falling back to context ‘default’

– Executing [s@default:1] Wait(“Local/1002@appel-sortant-f1e2;1”, “1”) in new stack
== Spawn extension (appel-sortant, 1002, 8) exited non-zero on ‘Local/1002@appel-sortant-f1e2;2’
– Executing [s@default:2] Answer(“SIP/1002-00000005”, “”) in new stack
– Executing [s@default:3] Set(“SIP/1002-00000005”, “TIMEOUT(digit)=5”) in new stack
– Digit timeout set to 5.000
– Executing [s@default:4] Set(“SIP/1002-00000005”, “TIMEOUT(response)=10”) in new stack
– Response timeout set to 10.000
– Executing [s@default:5] BackGround(“SIP/1002-00000005”, “demo-congrats”) in new stack
– <SIP/1002-00000005> Playing ‘demo-congrats.gsm’ (language ‘fr’)
== Spawn extension (default, s, 5) exited non-zero on ‘SIP/1002-00000005’
[Aug 21 09:27:28] NOTICE[12754]: pbx_spool.c:349 attempt_thread: Call completed to Local/1002@appel-sortant[/quote]

extensions.conf

[quote][appel-sortant]
exten => _X.,1,Set(LOOP=0)
exten => _X.,n,Set(MAX=3)
exten => _X.,n,Set(ACCEPT_INTER=0)
exten => _X.,n,Set(NEXT=0)

exten => _X.,n,NoOp(${CHANNEL})

exten => _X.,n,AGI(/var/lib/asterisk/agi-bin/getNext.php,${EXTEN})
exten => _X.,n,NoOp(${NEXT})

exten => _X.,n,Dial(SIP/${EXTEN},10,gtr)

exten => _X.,n,GotoIf($[${DIALSTATUS} == BUSY]?hang)
exten => _X.,n,Playback(silence/1)
exten => _X.,n,AMD()
exten => _X.,n,NoOp(${AMDSTATUS})
exten => _X.,n,GotoIf($[${AMDSTATUS}=MACHINE]?mach:appel-sortant-humn,${EXTEN},1) [/quote]

My sip.conf

[quote][forfait-ovh]
type=peer
host=sip.ovh.net
context=ovh-sip-entrant
language=fr
insecure=port
username=00339XXXXXXXX
secret=XXXXXXXX
nat=yes
canreinvite=no
dtmfmode=auto
video=no
restrictcid=no
amaflags=default[/quote]

My .call file is :

[quote]Channel: Local/1002@appel-sortant
Callerid: 09XXXXXXXX
MaxRetries: 0
RetryTime: 10
WaitTime: 20
Context: appel-sortant
Extension: s
Priority: 1[/quote]

If i change the s extention to 1002 :

[quote] – Executing [1002@appel-sortant:7] NoOp(“Local/1002@appel-sortant-cfaf;1”, “1003”) in new stack
– Executing [1002@appel-sortant:8] Dial(“Local/1002@appel-sortant-cfaf;1”, “SIP/1002,10,gtr”) in new stack
== Using SIP RTP CoS mark 5
– Called 1002
– Got SIP response 486 “Busy Here” back from 192.168.21.52
– SIP/1002-00000007 is busy
== Everyone is busy/congested at this time (1:1/0/0)

– Executing [1002@appel-sortant:9] GotoIf(“Local/1002@appel-sortant-cfaf;1”, “1?hang”) in new stack
– Goto (appel-sortant,1002,18)
– Executing [1002@appel-sortant:18] Hangup(“Local/1002@appel-sortant-cfaf;1”, “”) in new stack
== Spawn extension (appel-sortant, 1002, 18) exited non-zero on ‘Local/1002@appel-sortant-cfaf;1’
[Aug 21 09:50:33] NOTICE[12788]: pbx_spool.c:349 attempt_thread: Call completed to Local/1002@appel-sortant
== Spawn extension (appel-sortant, 1002, 8) exited non-zero on ‘Local/1002@appel-sortant-cfaf;2’
[/quote]

Should i use the _X. exten and then Goto the s exten before the dial ?