FusionPBX -> Asterisk routing

Status
Not open for further replies.

gflow

Active Member
Aug 25, 2019
267
31
28
Hi Guys,

I have a client with an asterisk pbx he still has some phones on my FusionPBX. He needs to be able to extension dial the local PBX extensions on both FusionPBX and Asterisk and also make outbound calls to the PSTN through FusionPBX. I have been able to get local extension dialling working between FusionPBX and Asterisk but when I dial an outbound PSTN number it fails. Any ideas?

This is what I followed to get the internal calling working.

 

gflow

Active Member
Aug 25, 2019
267
31
28
Haha true, maybe I overestimated your abilities ;)

I can see when I try to call outbound it goes into the public context so trying to figure out the best way to modify the dialplan so send the call out.


Code:
2021-02-18 09:29:09.862173 [NOTICE] switch_channel.c:1104 New Channel sofia/internal/709@pbx.service.com [b369d62a-716f-11eb-a5d0-899e9554f9a0]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/709@pbx.service.com) Running State Change CS_NEW (Cur 16 Tot 4576)
2021-02-18 09:29:09.862173 [DEBUG] sofia.c:10092 sofia/internal/709@pbx.service.com receiving invite from 33.33.33.33:5060 version: 1.8.4  64bit
2021-02-18 09:29:09.862173 [DEBUG] sofia.c:10208 IP 33.33.33.33 Approved by acl "domains[]". Access Granted.
2021-02-18 09:29:09.862173 [DEBUG] sofia.c:7291 Channel sofia/internal/709@pbx.service.com entering state [received][100]
2021-02-18 09:29:09.862173 [DEBUG] sofia.c:7301 Remote SDP:
v=0
o=root 982381285 982381285 IN IP4 33.33.33.33
s=Asterisk PBX 16.16.0
c=IN IP4 33.33.33.33
t=0 0
m=audio 13784 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150

2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[opus:116:48000:20:0:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[G722:9:8000:20:64000:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5533 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[opus:116:48000:20:0:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[G722:9:8000:20:64000:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5533 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5394 Set telephone-event payload to 101@8000
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:3781 Set Codec sofia/internal/709@pbx.service.com PCMU/8000 20 ms 160 samples 64000 bits 1 channels
2021-02-18 09:29:09.862173 [DEBUG] switch_core_codec.c:111 sofia/internal/709@pbx.service.com Original read codec set to PCMU:0
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5737 Set telephone-event payload to 101@8000
2021-02-18 09:29:09.862173 [DEBUG] switch_core_media.c:5795 sofia/internal/709@pbx.service.com Set 2833 dtmf send payload to 101 recv payload to 101
2021-02-18 09:29:09.862173 [DEBUG] sofia.c:7716 (sofia/internal/709@pbx.service.com) State Change CS_NEW -> CS_INIT
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:603 (sofia/internal/709@pbx.service.com) State NEW
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/709@pbx.service.com) Running State Change CS_INIT (Cur 16 Tot 4576)
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:627 (sofia/internal/709@pbx.service.com) State INIT
2021-02-18 09:29:09.862173 [DEBUG] mod_sofia.c:93 sofia/internal/709@pbx.service.com SOFIA INIT
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:40 sofia/internal/709@pbx.service.com Standard INIT
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:48 (sofia/internal/709@pbx.service.com) State Change CS_INIT -> CS_ROUTING
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:627 (sofia/internal/709@pbx.service.com) State INIT going to sleep
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/709@pbx.service.com) Running State Change CS_ROUTING (Cur 16 Tot 4576)
2021-02-18 09:29:09.862173 [DEBUG] switch_channel.c:2249 (sofia/internal/709@pbx.service.com) Callstate Change DOWN -> RINGING
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:643 (sofia/internal/709@pbx.service.com) State ROUTING
2021-02-18 09:29:09.862173 [DEBUG] mod_sofia.c:154 sofia/internal/709@pbx.service.com SOFIA ROUTING
2021-02-18 09:29:09.862173 [DEBUG] switch_core_state_machine.c:236 sofia/internal/709@pbx.service.com Standard ROUTING
2021-02-18 09:29:09.862173 [INFO] mod_dialplan_xml.c:637 Processing Josh Smith <709>->0400111222 in context public
Dialplan: sofia/internal/709@pbx.service.com parsing [public->caller-details] continue=true
Dialplan: sofia/internal/709@pbx.service.com Regex (PASS) [caller-details] () =~ // break=never
Dialplan: sofia/internal/709@pbx.service.com Action export(call_direction=inbound) INLINE
EXECUTE sofia/internal/709@pbx.service.com export(call_direction=inbound)
2021-02-18 09:29:09.872109 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [call_direction]=[inbound]
Dialplan: sofia/internal/709@pbx.service.com Action set(caller_destination=${sip_to_user}) INLINE
EXECUTE sofia/internal/709@pbx.service.com set(caller_destination=0400111222)
2021-02-18 09:29:09.872109 [DEBUG] mod_dptools.c:1598 SET sofia/internal/709@pbx.service.com [caller_destination]=[0400111222]
Dialplan: sofia/internal/709@pbx.service.com Action set(caller_id_name=${caller_id_name}) INLINE
EXECUTE sofia/internal/709@pbx.service.com set(caller_id_name=Josh Smith)
2021-02-18 09:29:09.872109 [DEBUG] mod_dptools.c:1598 SET sofia/internal/709@pbx.service.com [caller_id_name]=[Josh Smith]
Dialplan: sofia/internal/709@pbx.service.com Action set(caller_id_number=${caller_id_number})
Dialplan: sofia/internal/709@pbx.service.com Action set(ringback=%(400,200,400,425);%(400,2000,400,425)) INLINE
EXECUTE sofia/internal/709@pbx.service.com set(ringback=%(400,200,400,425);%(400,2000,400,425))
2021-02-18 09:29:09.872109 [DEBUG] mod_dptools.c:1598 SET sofia/internal/709@pbx.service.com [ringback]=[%(400,200,400,425);%(400,2000,400,425)]
Dialplan: sofia/internal/709@pbx.service.com parsing [public->timezone_GOLD_COAST] continue=true
Dialplan: sofia/internal/709@pbx.service.com Regex (FAIL) [timezone_GOLD_COAST] destination_number(0400111222) =~ /^617567633232/ break=on-false
Dialplan: sofia/internal/709@pbx.service.com parsing [public->timezone_QLD] continue=true
Dialplan: sofia/internal/709@pbx.service.com Regex (FAIL) [timezone_QLD] destination_number(0400111222) =~ /^617319999\d{2}/ break=on-false
Dialplan: sofia/internal/709@pbx.service.com parsing [public->timezone_PERTH] continue=true
Dialplan: sofia/internal/709@pbx.service.com Regex (FAIL) [timezone_PERTH] destination_number(0400111222) =~ /^618677532\d{2}/ break=on-false
 

gflow

Active Member
Aug 25, 2019
267
31
28
It looks through all the destinations then fails here:

Code:
Dialplan: sofia/internal/709@pbx.service.com Regex (FAIL) [61883788002] destination_number(0400111222) =~ /^(61883886655)$/ break=on-false
Dialplan: sofia/internal/709@pbx.service.com parsing [public->not-found] continue=false
Dialplan: sofia/internal/709@pbx.service.com Regex (PASS) [not-found] () =~ // break=on-false
Dialplan: sofia/internal/709@pbx.service.com Action export(call_direction=inbound) INLINE
EXECUTE sofia/internal/709@pbx.service.com export(call_direction=inbound)
2021-02-18 09:58:42.302113 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [call_direction]=[inbound]
Dialplan: sofia/internal/709@pbx.service.com Action set(call_direction=inbound) INLINE
EXECUTE sofia/internal/709@pbx.service.com set(call_direction=inbound)
2021-02-18 09:58:42.302113 [DEBUG] mod_dptools.c:1598 SET sofia/internal/709@pbx.service.com [call_direction]=[inbound]
Dialplan: sofia/internal/709@pbx.service.com Action log([inbound routes] 404 not found ${sip_network_ip})
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:286 (sofia/internal/709@pbx.service.com) State Change CS_ROUTING -> CS_EXECUTE
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:643 (sofia/internal/709@pbx.service.com) State ROUTING going to sleep
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/709@pbx.service.com) Running State Change CS_EXECUTE (Cur 5 Tot 4706)
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:650 (sofia/internal/709@pbx.service.com) State EXECUTE
2021-02-18 09:58:42.302113 [DEBUG] mod_sofia.c:209 sofia/internal/709@pbx.service.com SOFIA EXECUTE
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:328 sofia/internal/709@pbx.service.com Standard EXECUTE
EXECUTE sofia/internal/709@pbx.service.com set(caller_id_number=709)
2021-02-18 09:58:42.302113 [DEBUG] mod_dptools.c:1598 SET sofia/internal/709@pbx.service.com [caller_id_number]=[709]
EXECUTE sofia/internal/709@pbx.service.com log([inbound routes] 404 not found 33.33.33.33)
2021-02-18 09:58:42.302113 [DEBUG] mod_dptools.c:1792 routes] 404 not found 33.33.33.33
2021-02-18 09:58:42.302113 [NOTICE] switch_core_state_machine.c:385 sofia/internal/709@pbx.service.com has executed the last dialplan instruction, hanging up.
2021-02-18 09:58:42.302113 [NOTICE] switch_core_state_machine.c:387 Hangup sofia/internal/709@pbx.service.com [CS_EXECUTE] [NORMAL_CLEARING]
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:650 (sofia/internal/709@pbx.service.com) State EXECUTE going to sleep
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/709@pbx.service.com) Running State Change CS_HANGUP (Cur 5 Tot 4706)
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:847 (sofia/internal/709@pbx.service.com) Callstate Change RINGING -> HANGUP
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:849 (sofia/internal/709@pbx.service.com) State HANGUP
2021-02-18 09:58:42.302113 [DEBUG] mod_sofia.c:449 Channel sofia/internal/709@pbx.service.com hanging up, cause: NORMAL_CLEARING
2021-02-18 09:58:42.302113 [DEBUG] mod_sofia.c:588 Responding to INVITE with: 480
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:60 sofia/internal/709@pbx.service.com Standard HANGUP, cause: NORMAL_CLEARING
2021-02-18 09:58:42.302113 [DEBUG] switch_core_state_machine.c:849 (sofia/internal/709@pbx.service.com) State HANGUP going to sleep
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
I'm not familiar with how you are doing it. Because you are in the ACL it is treating you like a carrier ie looking for the number as a DID and then basiling when it doesn't find it.
 

gflow

Active Member
Aug 25, 2019
267
31
28
Oh sorry that link I posted was incorrect, this is exactly how I set up everything:

 
Status
Not open for further replies.