I’m trying to understand why I can’t dial out through a SIP peer acting as a trunk.
In what way are these two attempts to dial an outbound number different? The first at least reaches the peer for trunking? What’s happening, in particular, with the first call?
My inclination is for three contexts: internal, inbound and outbound. I don’t quite understand why https://www.beardy.se/how-to-set-up-a-sip-trunk-in-the-asterisk-pbx only has incoming
and myphones
, with myphones
also directing to…foo provider
? In sip.conf foo provider
has a context of incoming
but then is being used to dial out…which makes my head hurt.
Having difficulty following the chain of events from the last few lines of myphones
context where foo provider
is invoked. Good, yes, use foo provider
to dial out…but shouldn’t foo provider
not have an incoming
context if it’s being used for outgoing calls?
mordor*CLI>
mordor*CLI> channel originate SIP/thufir extension 918002506510@myphones
== Using SIP RTP CoS mark 5
-- Called thufir
-- SIP/thufir-0000002c is ringing
-- SIP/thufir-0000002c answered
-- Executing [918002506510@myphones:1] Log("SIP/thufir-0000002c", "NOTICE, Dialing out from "" <> to 18002506510 through 12345678GW1") in new stack
[Jul 2 04:52:14] NOTICE[6787][C-00000026]: Ext. 918002506510:1 @ myphones: Dialing out from "" <> to 18002506510 through 12345678GW1
-- Executing [918002506510@myphones:2] Dial("SIP/thufir-0000002c", "SIP/12345678GW1/18002506510,60") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/12345678GW1/18002506510
-- SIP/12345678GW1-0000002d answered SIP/thufir-0000002c
-- Channel SIP/thufir-0000002c joined 'simple_bridge' basic-bridge <6ed476b6-9c9e-4833-bc04-70e405f43dd2>
-- Channel SIP/12345678GW1-0000002d joined 'simple_bridge' basic-bridge <6ed476b6-9c9e-4833-bc04-70e405f43dd2>
-- Channel SIP/thufir-0000002c left 'native_rtp' basic-bridge <6ed476b6-9c9e-4833-bc04-70e405f43dd2>
== Spawn extension (myphones, 918002506510, 2) exited non-zero on 'SIP/thufir-0000002c'
-- Channel SIP/12345678GW1-0000002d left 'native_rtp' basic-bridge <6ed476b6-9c9e-4833-bc04-70e405f43dd2>
mordor*CLI>
mordor*CLI>
mordor*CLI> channel originate SIP/thufir extension 918002506510@incoming
== Using SIP RTP CoS mark 5
-- Called thufir
-- SIP/thufir-0000002e is ringing
-- SIP/thufir-0000002e answered
[Jul 2 04:52:44] WARNING[6792][C-00000027]: pbx.c:6492 __ast_pbx_run: Channel 'SIP/thufir-0000002e' sent to invalid extension but no invalid handler: context,exten,priority=incoming,918002506510,1
mordor*CLI>
mordor*CLI>
peers and trunk:
mordor*CLI>
mordor*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
12345678GW1/42654565 63.247.69.226 Yes Yes 5060 OK (85 ms)
12345678GW2/42654565 63.247.69.226 Yes Yes 5060 OK (82 ms)
demo_alice (Unspecified) D Yes Yes 0 UNKNOWN
demo_bob (Unspecified) D Yes Yes 0 UNKNOWN
hawat/hawat 192.168.1.6 D Yes Yes 5060 OK (410 ms)
thufir/thufir 192.168.1.5 D Yes Yes 5062 OK (9 ms)
6 sip peers [Monitored: 4 online, 2 offline Unmonitored: 0 online, 0 offline]
mordor*CLI>
mordor*CLI> sip show peer 12345678GW1
* Name : 12345678GW1
Description :
Secret : <Set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : incoming
Record On feature : automon
Record Off feature : automon
Subscr.Cont. : <Not set>
Language :
Tonezone : <Not set>
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
FromDomain : gw1.siptrunk.com Port 5060
Callgroup :
Pickupgroup :
Named Callgr :
Nam. Pickupgr:
MOH Suggest :
Mailbox :
VM Extension : asterisk
LastMsgsSent : 0/0
Call limit : 0
Max forwards : 0
Dynamic : No
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : invite
Force rport : Yes
Symmetric RTP: Yes
ACL : No
DirectMedACL : No
T.38 support : No
T.38 EC mode : Unknown
T.38 MaxDtgrm: 4294967295
DirectMedia : No
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : Yes
Send RPID : No
Path support : No
Path : N/A
TrustIDOutbnd: Legacy
Subscriptions: Yes
Overlap dial : No
DTMFmode : rfc2833
Timer T1 : 500
Timer B : 32000
ToHost : gw1.siptrunk.com
Addr->IP : 63.247.69.226:5060
Defaddr->IP : (null)
Prim.Transp. : UDP
Allowed.Trsp : UDP
Def. Username: 42654565
SIP Options : (none)
Codecs : (ulaw|alaw|gsm)
Auto-Framing : No
Status : OK (85 ms)
Useragent :
Reg. Contact :
Qualify Freq : 30000 ms
Keepalive : 0 ms
Sess-Timers : Refuse
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
RTP Engine : asterisk
Parkinglot :
Use Reason : No
Encryption : No
dialplan:
mordor*CLI>
mordor*CLI> dialplan show
__func_periodic_hook_context__ ael-builtin-h-bubble ael-default ael-demo
ael-dundi-e164 ael-dundi-e164-canonical ael-dundi-e164-customers ael-dundi-e164-local
ael-dundi-e164-lookup ael-dundi-e164-switch ael-dundi-e164-via-pstn ael-iaxprovider
ael-iaxtel700 ael-international ael-local ael-longdistance
ael-std-exten-ael ael-trunkint ael-trunkld ael-trunklocal
ael-trunktollfree chanvar default demo
globals local myphones parkedcalls
public incoming
mordor*CLI> dialplan show myphones
[ Context 'myphones' created by 'pbx_config' ]
'1000' => 1. Dial(SIP/1000) [pbx_config]
2. Hangup() [pbx_config]
'1001' => 1. Dial(SIP/1001) [pbx_config]
2. Hangup() [pbx_config]
'201' => 1. Answer() [pbx_config]
2. Playback(tt-monty-knights) [pbx_config]
3. Hangup() [pbx_config]
'202' => 1. Answer() [pbx_config]
2. Playback(welcome) [pbx_config]
3. Playback(demo-echotest) [pbx_config]
4. Echo() [pbx_config]
5. Playback(demo-echodone) [pbx_config]
6. Playback(vm-goodbye) [pbx_config]
7. Hangup() [pbx_config]
'4000' => 1. Playback(tt-monkeys) [pbx_config]
'5000' => 1. Playback(tt-monkeysintro) [pbx_config]
'555' => 1. Playback(hello-world) [pbx_config]
2. Playback(echo-test) [pbx_config]
3. Echo() [pbx_config]
4. Playback(demo-echodone) [pbx_config]
'6001' => 1. Dial(SIP/demo_alice,20) [pbx_config]
'6002' => 1. Dial(SIP/demo_bob,20) [pbx_config]
'6003' => 1. Dial(SIP/thufir,20) [pbx_config]
'6004' => 1. Dial(SIP/hawat,20) [pbx_config]
'_9XXXX.' => 1. Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN:1} through 12345678GW1) [pbx_config]
2. Dial(SIP/12345678GW1/${EXTEN:1},60) [pbx_config]
3. Playtones(congestion) [pbx_config]
4. Hangup() [pbx_config]
-= 12 extensions (28 priorities) in 1 context. =-
mordor*CLI>
mordor*CLI>
mordor*CLI> dialplan show incoming
[ Context 'incoming' created by 'pbx_config' ]
's' => 1. Log(NOTICE, Incoming call from ${CALLERID(all)}) [pbx_config]
2. Dial(SIP/1000) [pbx_config]
3. Hangup() [pbx_config]
-= 1 extension (3 priorities) in 1 context. =-
mordor*CLI>
I’ve tried many variations on dialing the number to match the pattern. this is largely based on: