* and 2 voice gateways

pstn-spa3k and pstn-spa3k2 it’s 2 voice gateways SPA3000

[101]
username=101
type=friend
secret=101
record_out=Always
record_in=Always
qualify=yes
port=5060
pickupgroup=1
nat=never
mailbox=101@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callgroup=1
callerid=ShturmOfficeee <101>

[102]
username=102
type=friend
secret=102
record_out=Always
record_in=Always
qualify=yes
port=5060
pickupgroup=1
nat=never
mailbox=102@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callgroup=1
callerid=StamperOffice <102>

[pstn-spa3k]
username=asterisk
type=peer
secret=777888
qulify=yes
port=5061
insecure=very
host=192.168.90.60
fromuser=asterisk
dtmfmode=rfc2833
context=from-internal
auth=md5

[pstn-spa3k2]
username=asterisk
type=peer
secret=66778899
qulify=yes
port=5061
insecure=very
host=192.168.13.150
fromuser=asterisk
dtmfmode=rfc2833
context=from-internal
auth=md5

exten => _XXXXX,1,Dial(SIP/${EXTEN}@pstn-spa3k,60) ; Infolink like a 20399
exten => _XXXXX,2,Goto(pstn-spa3k-${DIALSTATUS},1)
exten => _XXXXX,3,Hangup
exten => pstn-spa3k-NOANSWER,1,Dial(SIP/${EXTEN}@pstn-spa3k2,60,TtWw)
exten => pstn-spa3k-BUSY,1,Dial(SIP/${EXTEN}@pstn-spa3k2,60,TtWw)
exten => pstn-spa3k-CHANUNAVAIL,1,Dial(SIP/${EXTEN}@pstn-spa3k2,60,TtWw)

in CLI I have thise:
Thats what in CLI when i call first to one PSTN number and when hear what doing I began to call from second phone to the PSTN number too:

– Executing Dial(“SIP/102-9465”, “SIP/05100@pstn-spa3k|60”) in new stack
– Called 05100@pstn-spa3k
– SIP/pstn-spa3k-e0f9 is ringing
– SIP/pstn-spa3k-e0f9 answered SIP/102-9465
– Attempting native bridge of SIP/102-9465 and SIP/pstn-spa3k-e0f9
– Executing Dial(“SIP/101-21db”, “SIP/05100@pstn-spa3k|60”) in new stack
– Called 05100@pstn-spa3k
– Got SIP response 504 “Service Unavailable” back from 192.168.90.60
== No one is available to answer at this time (1:0/0/0)
– Executing Goto(“SIP/101-21db”, “pstn-spa3k-NOANSWER|1”) in new stack
– Goto (from-internal,pstn-spa3k-NOANSWER,1)
– Executing Dial(“SIP/101-21db”, “SIP/pstn-spa3k-NOANSWER@pstn-spa3k2|60|TtWw”) in new stack
– Called pstn-spa3k-NOANSWER@pstn-spa3k2
– SIP/pstn-spa3k2-2c68 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
– Executing Hangup(“SIP/102-9465”, “”) in new stack
– Executing Hangup(“SIP/101-21db”, “”) in new stack

Where I wrong ?
Thanks !

exten => _XXXXX,2,Goto(pstn-spa3k-${DIALSTATUS},1)
goes to the extension ‘pstn-spa3k-CHANUNAVAIL’, which it then tries to dial-

– Executing Dial(“SIP/101-21db”, “SIP/pstn-spa3k-NOANSWER@pstn-spa3k2|60|TtWw”) in new stack

perhaps you are mixing up the exten and the priority? I am pretty sure you can do it like this…

exten => _XXXXX,1,Dial(SIP/${EXTEN}@pstn-spa3k,60) ; Infolink like a 20399
exten => _XXXXX,2,Goto(${DIALSTATUS})
exten => _XXXXX,3,Hangup
exten => _XXXXX,NOANSWER,Dial(SIP/${EXTEN}@pstn-spa3k2,60,TtWw)
exten => _XXXXX,BUSY,Dial(SIP/${EXTEN}@pstn-spa3k2,60,TtWw)
exten => _XXXXX,CHANUNAVAIL,Dial(SIP/${EXTEN}@pstn-spa3k2,60,TtWw)

That way the original exten is preserved but you just jump priority?

Hi

This does not seem to work, I tried it and this happens:

Nobody picked up in 10000 ms
– Executing Goto(“SIP/yusuf_mayet-083653d8”, “NOANSWER”) in new stack
Dec 27 10:12:14 NOTICE[13125]: pbx.c:1753 pbx_extension_helper: No such label ‘NOANSWER’ in extension ‘00847741471’ in context 'sip’
Dec 27 10:12:14 WARNING[13125]: pbx.c:6515 ast_parseable_goto: Priority ‘NOANSWER’ must be a number > 0, or valid label