sip trunk to Cisco 2911 not working

Status
Not open for further replies.

mrjoli021

Member
Jul 20, 2017
133
2
18
47
I have a cisco 2911 which has an 8 port FSX card. I am trying to setup a SIP trunk so that I can send it some DID's and/or extensions to it. My plan is to connect a couple of analog phone and/or faxes. I have setup a bridge with the syntax below which I got from a previous SIP Trunking forum. I have added my destination to point to this bridge.

sofia/internal/sip:$1${regex(${sofia_contact101021@10.21.10.12)}|^[^@]+(.*)|%1)}

When I call 7778889999 from my cell phone Freeswitch responds and attempts to bridge the call, but it seems like my syntax is wrong then dies within freeswitch. The call never gets to the Cisco 2911. What am I missing?
My Fusionbox = 10.21.10.4
Cisco 2911 = 10.21.10.12

######################################
Dialplan: sofia/internal/+13334445555@sip.mydomain.com Action set(continue_on_fail=true)
Dialplan: sofia/internal/+13334445555@sip.mydomain.com Action bridge(sofia/internal/sip:17778889999${regex(${sofia_contact101021@10.21.10.12)}|^[^@]+(.*)|%1)})
2020-03-13 20:51:39.234828 [DEBUG] switch_core_state_machine.c:286 (sofia/internal/+13334445555@sip.mydomain.com) State Change CS_ROUTING -> CS_EXECUTE
2020-03-13 20:51:39.234828 [DEBUG] switch_core_state_machine.c:643 (sofia/internal/+13334445555@sip.mydomain.com) State ROUTING going to sleep
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/+13334445555@sip.mydomain.com) Running State Change CS_EXECUTE (Cur 1 Tot 493)
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:650 (sofia/internal/+13334445555@sip.mydomain.com) State EXECUTE
2020-03-13 20:51:39.254804 [DEBUG] mod_sofia.c:198 sofia/internal/+13334445555@sip.mydomain.com SOFIA EXECUTE
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:328 sofia/internal/+13334445555@sip.mydomain.com Standard EXECUTE
EXECUTE sofia/internal/+13334445555@sip.mydomain.com set(call_direction=inbound)
2020-03-13 20:51:39.254804 [DEBUG] mod_dptools.c:1548 SET sofia/internal/+13334445555@sip.mydomain.com [call_direction]=[inbound]
EXECUTE sofia/internal/+13334445555@sip.mydomain.com set(hangup_after_bridge=true)
2020-03-13 20:51:39.254804 [DEBUG] mod_dptools.c:1548 SET sofia/internal/+13334445555@sip.mydomain.com [hangup_after_bridge]=[true]
EXECUTE sofia/internal/+13334445555@sip.mydomain.com set(continue_on_fail=true)
2020-03-13 20:51:39.254804 [DEBUG] mod_dptools.c:1548 SET sofia/internal/+13334445555@sip.mydomain.com [continue_on_fail]=[true]
EXECUTE sofia/internal/+13334445555@sip.mydomain.com bridge(sofia/internal/sip:17778889999-ERR)
2020-03-13 20:51:39.254804 [DEBUG] switch_channel.c:1250 sofia/internal/+13334445555@sip.mydomain.com EXPORTING[export_vars] [call_direction]=[inbound] to event
2020-03-13 20:51:39.254804 [DEBUG] switch_channel.c:1250 sofia/internal/+13334445555@sip.mydomain.com EXPORTING[export_vars] [call_direction]=[inbound] to event
2020-03-13 20:51:39.254804 [DEBUG] switch_channel.c:1250 sofia/internal/+13334445555@sip.mydomain.com EXPORTING[export_vars] [call_direction]=[inbound] to event
2020-03-13 20:51:39.254804 [DEBUG] switch_ivr_originate.c:2142 Parsing global variables
2020-03-13 20:51:39.254804 [NOTICE] switch_channel.c:1104 New Channel sofia/internal/sip:17778889999-ERR [0533017a-f4c5-42a3-8090-2db1cff821c0]
2020-03-13 20:51:39.254804 [DEBUG] mod_sofia.c:4819 (sofia/internal/sip:17778889999-ERR) State Change CS_NEW -> CS_INIT
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/sip:17778889999-ERR) Running State Change CS_INIT (Cur 2 Tot 494)
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:627 (sofia/internal/sip:17778889999-ERR) State INIT
2020-03-13 20:51:39.254804 [DEBUG] mod_sofia.c:90 sofia/internal/sip:17778889999-ERR SOFIA INIT
2020-03-13 20:51:39.254804 [DEBUG] sofia_glue.c:1295 sofia/internal/sip:17778889999-ERR sending invite version: 1.6.20 -37-987c9b9 64bit
Local SDP:
v=0
o=FreeSWITCH 1584116509 1584116510 IN IP4 10.21.10.4
s=FreeSWITCH
c=IN IP4 10.21.10.4
t=0 0
m=audio 30590 RTP/AVP 0 9 8 3 101 13
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:13 CN/8000
a=ptime:20
a=sendrecv

2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:40 sofia/internal/sip:17778889999-ERR Standard INIT
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:48 (sofia/internal/sip:17778889999-ERR) State Change CS_INIT -> CS_ROUTING
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:627 (sofia/internal/sip:17778889999-ERR) State INIT going to sleep
2020-03-13 20:51:39.254804 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/sip:17778889999-ERR) Running State Change CS_ROUTING (Cur 2 Tot 494)
2020-03-13 20:51:39.254804 [DEBUG] sofia.c:7084 Channel sofia/internal/sip:17778889999-ERR entering state [calling][0]
2020-03-13 20:51:39.254804 [DEBUG] sofia.c:7084 Channel sofia/internal/sip:17778889999-ERR entering state [terminated][503]
2020-03-13 20:51:39.254804 [NOTICE] sofia.c:8273 Hangup sofia/internal/sip:17778889999-ERR [CS_ROUTING] [NORMAL_TEMPORARY_FAILURE]
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
The bridge statement you show is wrong. The info in the user@domain.com part is supposed to be the extension number in your Fusionpbx server. It looks like you are trying a direct bridge to an endpoint.

The “fancy” bridge statement is for sending the direct number to the correct endpoint by reading the info for the selected registered extension. If you aren’t using registration your bridge statement can be as easy as:

sofia/internal/sip:$1@10.21.10.12:5060
 

mrjoli021

Member
Jul 20, 2017
133
2
18
47
That worked thanks. Inbound calls now work beautifully. The issue I am having now is that when I make an outbound call I am getting "INCOMPATIBLE_DESTINATION". I have an outbound route that all my other extensions are using and it works fine with a 1 and without a 1 I am able to dial US national numbers. However when I dial from the Cisco 2911 it does not work. I have added the IAD to the ACL but I keep getting a 488. Calls dont go out to the provider the 488 is coming from Freeswitch. Any idea why?

Also one weird thing I did notice is that freeswitch is giving me a buggy error:
Activate Buggy RFC2833 Mode!

###############################
2020-03-14 20:14:58.794783 [NOTICE] switch_channel.c:1104 New Channel sofia/internal/17778889999@10.21.10.12 [2743230e-402f-48cd-aab3-18f6ae97ae03]
2020-03-14 20:14:58.794783 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/17778889999@10.21.10.12) Running State Change CS_NEW (Cur 1 Tot 634)
2020-03-14 20:14:58.794783 [DEBUG] sofia.c:9873 sofia/internal/17778889999@10.21.10.12 receiving invite from 10.21.10.12:50147 version: 1.6.20 -37-987c9b9 64bit
2020-03-14 20:14:58.794783 [DEBUG] sofia.c:9989 IP 10.21.10.12 Approved by acl "domains[]". Access Granted.
2020-03-14 20:14:58.794783 [DEBUG] sofia.c:11168 Setting NAT mode based on via port
2020-03-14 20:14:58.794783 [DEBUG] sofia.c:7084 Channel sofia/internal/17778889999@10.21.10.12 entering state [received][100]
2020-03-14 20:14:58.794783 [DEBUG] sofia.c:7094 Remote SDP:
v=0
o=CiscoSystemsSIP-GW-UserAgent 670 6725 IN IP4 10.21.10.12
s=SIP Call
c=IN IP4 10.21.10.12
t=0 0
m=audio 18982 RTP/AVP 18 101
c=IN IP4 10.21.10.12
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20

2020-03-14 20:14:58.794783 [DEBUG] switch_core_media.c:3916 Activate Buggy RFC2833 Mode!
2020-03-14 20:14:58.794783 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[G722:9:8000:20:64000:1]
2020-03-14 20:14:58.794783 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMU:0:8000:20:64000:1]
2020-03-14 20:14:58.794783 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMA:8:8000:20:64000:1]
2020-03-14 20:14:58.794783 [DEBUG] switch_core_media.c:4449 Audio Codec Compare [G729:18:8000:20:8000:1]/[GSM:3:8000:20:13200:1]
2020-03-14 20:14:58.794783 [DEBUG] switch_core_media.c:4365 Set telephone-event payload to 101@8000
2020-03-14 20:14:58.794783 [DEBUG] switch_core_media.c:4767 sofia/internal/17778889999@10.21.10.12 Set 2833 dtmf send payload to 101 recv payload to 101
2020-03-14 20:14:58.794783 [NOTICE] sofia.c:7565 Hangup sofia/internal/17778889999@10.21.10.12 [CS_NEW] [INCOMPATIBLE_DESTINATION]
2020-03-14 20:14:58.794783 [DEBUG] switch_core_state_machine.c:603 (sofia/internal/17778889999@10.21.10.12) State NEW
2020-03-14 20:14:58.794783 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/17778889999@10.21.10.12) Running State Change CS_HANGUP (Cur 1 Tot 634)
2020-03-14 20:14:58.794783 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/17778889999@10.21.10.12) Callstate Change DOWN -> HANGUP
2020-03-14 20:14:58.794783 [DEBUG] switch_core_state_machine.c:852 (sofia/internal/17778889999@10.21.10.12) State HANGUP
2020-03-14 20:14:58.794783 [DEBUG] mod_sofia.c:438 Channel sofia/internal/17778889999@10.21.10.12 hanging up, cause: INCOMPATIBLE_DESTINATION
2020-03-14 20:14:58.794783 [DEBUG] mod_sofia.c:577 Responding to INVITE with: 488
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
Not sure on the “buggy” mode.
The call failed because the Cisco sent “G729/8000” as the only codec and your Freeswitch doesn’t use G729.
Tell your Cisco to send ULAW (G711u) as the preferred codec and you should have better luck.
 

mrjoli021

Member
Jul 20, 2017
133
2
18
47
I should have caught that. I fixed it so that the call comes in as g711. Now that issue is that it is going to the public context and treating the call as an inbound call.

#####################################
2020-03-15 14:36:13.374811 [DEBUG] mod_sofia.c:143 sofia/internal/17778889999@10.21.10.12 SOFIA ROUTING
2020-03-15 14:36:13.374811 [DEBUG] switch_core_state_machine.c:236 sofia/internal/17778889999@10.21.10.12 Standard ROUTING
2020-03-15 14:36:13.374811 [INFO] mod_dialplan_xml.c:637 Processing 17778889999 <17778889999>->3334445555 in context public
Dialplan: sofia/internal/17778889999@10.21.10.12 parsing [public->caller-details] continue=true
Dialplan: sofia/internal/17778889999@10.21.10.12 Regex (PASS) [caller-details] () =~ // break=never
Dialplan: sofia/internal/17778889999@10.21.10.12 Action export(call_direction=inbound) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 export(call_direction=inbound)
2020-03-15 14:36:13.374811 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [call_direction]=[inbound]
Dialplan: sofia/internal/17778889999@10.21.10.12 Action set(caller_destination=${destination_number}) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 set(caller_destination=3334445555)
2020-03-15 14:36:13.374811 [DEBUG] mod_dptools.c:1548 SET sofia/internal/17778889999@10.21.10.12 [caller_destination]=[3334445555]
Dialplan: sofia/internal/17778889999@10.21.10.12 Action set(caller_id_name=${caller_id_name}) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 set(caller_id_name=17778889999)
2020-03-15 14:36:13.374811 [DEBUG] mod_dptools.c:1548 SET sofia/internal/17778889999@10.21.10.12 [caller_id_name]=[17778889999]
Dialplan: sofia/internal/17778889999@10.21.10.12 Action set(caller_id_number=${caller_id_number}) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 set(caller_id_number=17778889999)
2020-03-15 14:36:13.374811 [DEBUG] mod_dptools.c:1548 SET sofia/internal/17778889999@10.21.10.12 [caller_id_number]=[17778889999]
Dialplan: sofia/internal/17778889999@10.21.10.12 parsing [public->17778889999] continue=false
Dialplan: sofia/internal/17778889999@10.21.10.12 Regex (FAIL) [17778889999] destination_number(3334445555) =~ /^(17778889999)$/ break=on-false
Dialplan: sofia/internal/17778889999@10.21.10.12 parsing [public->not-found] continue=false
Dialplan: sofia/internal/17778889999@10.21.10.12 Regex (PASS) [not-found] () =~ // break=on-false
Dialplan: sofia/internal/17778889999@10.21.10.12 Action export(call_direction=inbound) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 export(call_direction=inbound)
2020-03-15 14:36:13.374811 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [call_direction]=[inbound]
Dialplan: sofia/internal/17778889999@10.21.10.12 Action set(domain_name=10.21.10.4) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 set(domain_name=10.21.10.4)
2020-03-15 14:36:13.374811 [DEBUG] mod_dptools.c:1548 SET sofia/internal/17778889999@10.21.10.12 [domain_name]=[10.21.10.4]
Dialplan: sofia/internal/17778889999@10.21.10.12 Action set(call_direction=inbound) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 set(call_direction=inbound)
2020-03-15 14:36:13.374811 [DEBUG] mod_dptools.c:1548 SET sofia/internal/17778889999@10.21.10.12 [call_direction]=[inbound]
Dialplan: sofia/internal/17778889999@10.21.10.12 Action log([inbound routes] 404 not found ${sip_network_ip}) INLINE
EXECUTE sofia/internal/17778889999@10.21.10.12 log([inbound routes] 404 not found 10.21.10.12)
2020-03-15 14:36:13.374811 [DEBUG] mod_dptools.c:1742 routes] 404 not found 10.21.10.12
2020-03-15 14:36:13.374811 [DEBUG] switch_core_state_machine.c:286 (sofia/internal/17778889999@10.21.10.12) State Change CS_ROUTING -> CS_EXECUTE
2020-03-15 14:36:13.374811 [DEBUG] switch_core_state_machine.c:643 (sofia/internal/17778889999@10.21.10.12) State ROUTING going to sleep
2020-03-15 14:36:13.394774 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/17778889999@10.21.10.12) Running State Change CS_EXECUTE (Cur 1 Tot 642)
2020-03-15 14:36:13.394774 [DEBUG] switch_core_state_machine.c:650 (sofia/internal/17778889999@10.21.10.12) State EXECUTE
2020-03-15 14:36:13.394774 [DEBUG] mod_sofia.c:198 sofia/internal/17778889999@10.21.10.12 SOFIA EXECUTE
2020-03-15 14:36:13.394774 [DEBUG] switch_core_state_machine.c:328 sofia/internal/17778889999@10.21.10.12 Standard EXECUTE
2020-03-15 14:36:13.394774 [NOTICE] switch_core_state_machine.c:385 sofia/internal/17778889999@10.21.10.12 has executed the last dialplan instruction, hanging up.
2020-03-15 14:36:13.394774 [NOTICE] switch_core_state_machine.c:387 Hangup sofia/internal/17778889999@10.21.10.12 [CS_EXECUTE] [NORMAL_CLEARING]
2020-03-15 14:36:13.394774 [DEBUG] switch_core_state_machine.c:650 (sofia/internal/17778889999@10.21.10.12) State EXECUTE going to sleep
2020-03-15 14:36:13.394774 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/17778889999@10.21.10.12) Running State Change CS_HANGUP (Cur 1 Tot 642)
2020-03-15 14:36:13.394774 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/17778889999@10.21.10.12) Callstate Change RINGING -> HANGUP
2020-03-15 14:36:13.394774 [DEBUG] switch_core_state_machine.c:852 (sofia/internal/17778889999@10.21.10.12) State HANGUP
2020-03-15 14:36:13.394774 [DEBUG] mod_sofia.c:438 Channel sofia/internal/17778889999@10.21.10.12 hanging up, cause: NORMAL_CLEARING
2020-03-15 14:36:13.394774 [DEBUG] mod_sofia.c:577 Responding to INVITE with: 480
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
Remove the Cisco from your domains ACL.
Give the Cisco an extension it can authenticate with
 
Status
Not open for further replies.