Freepbx trunk from Freeswitch unable to route calls from Freeswitch thru freepbx on outbound routes

I have a distro freepbx (current version with current modules) setup that is working with phones connected, able to call out outbound routes to external numbers.

We also have another system that uses Freeswitch pbx with a few phones attached. Have implemented at SIP trunk between the two PBXs. Freeswitch phones are able to call the freepbx phones and visa versa. But the Freeswitch phones try to make an outside call… it routes to the Freepbx pbx as it should, but dies there. The SIP trunk is set to: context=from-internal so it should be using the dialplan of the Freebpx box but doesn’t seem to.

Any help or ideas would be greatly appreciated, and like usually, I’m needing to get it working quickly

Thanks

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug#ProvidingGreatDebug-AsteriskLogs

Here is the trunk configuration on the freepbx box.
outgoing Trunk name: ToDispatchPBX
host=192.168.62.30
type=friend
quality=yes

incoming User Context: fromDispatchPBX
context=from-internal&from-trunk
type=friend
insecure=very
quality=yes
port=5060
deny=0.0.0.0/0.0.0.0
permit=192.168.62.30/255.255.255.255
disallow=all
allow=ulaw
trustrpid=yes
sendrpid=yes

There is no authentication between the two PBXs - they are both on our internal network, trunk on it’s own VLAN.
I started out with the bare minimum config settings in the trunk, with the same results
Outgoing
host=192.168.62.30
type=friend (I’ve tried, peer, friend, user)

incoming
context=from-internal
type=friend (I’ve tried, peer, friend, user)

Asterisk Log capture from the freepbx while trying to make out external from the Freeswitch PBX, from the Freeswitch it gets sent to the Freepbx box thru the trunk as it is supposed to. but the calling phone gets a ‘not a working number’ error

[2017-08-19 09:51:31] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4153
[2017-08-19 09:51:32] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4153
[2017-08-19 09:51:47] NOTICE[27763] manager.c: 127.0.0.1 tried to authenticate with nonexistent user 'cxpanel'
[2017-08-19 09:51:47] NOTICE[27763] manager.c: 127.0.0.1 failed to authenticate as 'cxpanel'
[2017-08-19 09:51:49] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4106
[2017-08-19 09:51:50] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4106
[2017-08-19 09:51:52] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4154
[2017-08-19 09:51:53] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4154

->>>  external call from the FreeSwitch initiated at this time

[2017-08-19 09:51:55] VERBOSE[2589][C-00001505] netsock2.c: Using SIP RTP TOS bits 184
[2017-08-19 09:51:55] VERBOSE[2589][C-00001505] netsock2.c: Using SIP RTP CoS mark 5
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx.c: Executing [**externalphonenumber**@from-trunk-sip-ToDispatchPBX:1] Set("SIP/ToDispatchPBX-000030f3", "GROUP()=OUT_12") in new stack
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx.c: Executing [**externalphonenumber**@from-trunk-sip-ToDispatchPBX:2] Goto("SIP/ToDispatchPBX-000030f3", "from-trunk,**externalphonenumber**,1") in new stack
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx_builtins.c: Goto (from-trunk,**externalphonenumber**,1)
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx.c: Executing [**externalphonenumber**@from-trunk:1] Set("SIP/ToDispatchPBX-000030f3", "__FROM_DID=**externalphonenumber**") in new stack
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx.c: Executing [**externalphonenumber**@from-trunk:2] NoOp("SIP/ToDispatchPBX-000030f3", "Received an unknown call with DID set to **externalphonenumber**") in new stack
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx.c: Executing [**externalphonenumber**@from-trunk:3] Goto("SIP/ToDispatchPBX-000030f3", "s,a2") in new stack
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx_builtins.c: Goto (from-trunk,s,2)
[2017-08-19 09:51:55] VERBOSE[27768][C-00001505] pbx.c: Executing [s@from-trunk:2] Answer("SIP/ToDispatchPBX-000030f3", "") in new stack
[2017-08-19 09:51:56] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4152
[2017-08-19 09:51:56] VERBOSE[27768][C-00001505] pbx.c: Executing [s@from-trunk:3] Log("SIP/ToDispatchPBX-000030f3", "WARNING,Friendly Scanner from 192.168.62.30;rport;branch=z9hG4bKF4eZQFeS5HrBD") in new stack
[2017-08-19 09:51:56] WARNING[27768][C-00001505] Ext. s: Friendly Scanner from 192.168.62.30;rport;branch=z9hG4bKF4eZQFeS5HrBD
[2017-08-19 09:51:56] VERBOSE[27768][C-00001505] pbx.c: Executing [s@from-trunk:4] Wait("SIP/ToDispatchPBX-000030f3", "2") in new stack
[2017-08-19 09:51:56] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4109
[2017-08-19 09:51:57] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4152
[2017-08-19 09:51:57] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4109
[2017-08-19 09:51:58] VERBOSE[27768][C-00001505] pbx.c: Executing [s@from-trunk:5] Playback("SIP/ToDispatchPBX-000030f3", "ss-noservice") in new stack
[2017-08-19 09:51:58] VERBOSE[27768][C-00001505] file.c: <SIP/ToDispatchPBX-000030f3> Playing 'ss-noservice.ulaw' (language 'en')
[2017-08-19 09:51:58] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4192
[2017-08-19 09:51:59] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4192
[2017-08-19 09:51:59] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4151
[2017-08-19 09:52:00] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4151
[2017-08-19 09:52:02] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4153
[2017-08-19 09:52:03] VERBOSE[27768][C-00001505] pbx.c: Executing [s@from-trunk:6] SayAlpha("SIP/ToDispatchPBX-000030f3", "**externalphonenumber**") in new stack
[2017-08-19 09:52:03] VERBOSE[27768][C-00001505] file.c: <SIP/ToDispatchPBX-000030f3> Playing 'digits/9.ulaw' (language 'en')
[2017-08-19 09:52:03] NOTICE[27836] manager.c: 127.0.0.1 tried to authenticate with nonexistent user 'cxpanel'
[2017-08-19 09:52:03] NOTICE[27836] manager.c: 127.0.0.1 failed to authenticate as 'cxpanel'
[2017-08-19 09:52:03] VERBOSE[27768][C-00001505] file.c: <SIP/ToDispatchPBX-000030f3> Playing 'digits/7.ulaw' (language 'en')
[2017-08-19 09:52:04] NOTICE[2589] chan_sip.c: Received SIP subscribe for peer without mailbox: 4153
[2017-08-19 09:52:04] VERBOSE[27768][C-00001505] file.c: <SIP/ToDispatchPBX-000030f3> Playing 'digits/0.ulaw' (language 'en')
^X[2017-08-19 09:52:05] VERBOSE[27768][C-00001505] file.c: <SIP/ToDispatchPBX-000030f3> Playing 'digits/5.ulaw' (language 'en')
[2017-08-19 09:52:06] VERBOSE[27768][C-00001505] file.c: <SIP/ToDispatchPBX-000030f3> Playing 'digits/8.ulaw' (language 'en')
[2017-08-19 09:52:06] VERBOSE[27768][C-00001505] file.c: <SIP/ToDispatchPBX-000030f3> Playing 'digits/1.ulaw' (language 'en')
^C

This is the issue, wherever did you come up with this as a valid context? You want one or the other, based on the initial post, you prob want from-internal Superseded by posts that follow

As I said, I started with context=from-internal and had the this problem from the beginning trying to get this set up and working. For the past day I’ve been searching for anything and everything to try. the context=from-internal&from-truck came from something I was read yesterday night so thought I’d get it a try.

I should add here, that I did have Freepbx ‘Extension Routing’ module installed, but we had no need for it and removed it this morning, thinking maybe it was blocking access to the outbound route since the call was not coming from an extension on the Freepbx box (there is no place in Extension Routing to allow access to an outbound route except by extension.

First line tells you something is up with the context:

Executing [**externalphonenumber**@from-trunk-sip-ToDispatchPBX:1]

So Asterisk is annoying in that sometimes inbound calls match a trunk you don’t expect. In this case inbound calls are recognized as coming from the ToDispatchPBX trunk. You don’t have a context line for that trunk, so it uses the FreePBX default for a trunk and treats the call as an inbound trunk call. The fix is to set the context to from-internal.

Ok, I’ll set it back to from-internal
and run the log again and post it.

My assumption (and granted I don’t know what I’m talking about) was that this Executing [externalphonenumber@from-trunk-sip-ToDispatchPBX:1] is were it was setting up the response back to the Freeswitch box "ToDispatchPBX is the outgoing thru the Trunk back to the Freeswitch box that the call just came from

Your assumption is only partially correct, and the log lines provided prove it. Add the proper context to ToDispatchPBX and you will be pleasantly surprised.

add
context=from-internal

to the outgoing settings on the trunk??
am I understanding you correctly

On the SIP trunk configuration page in freebpx for this trunk.
On the General tab the ‘trunk name’ is : linktoDispatch
on the SIP settings tab - outgoing tab, the ‘trunk name’ is: ToDispatchPBX and on the incoming tab, the user context is: fromDispatchPBX

I’ve never run across putting a context setting in the outgoing settings of a trunk?

We’re getting ready to try it shortly as the other system becomes available again for my testing.

Thanks for your heIp lgaetz!

Just to recap on this, Adding context=from-internal to the outgoing settings of the trunk did work.

I had never run into added a context=from-internal in the outgoing settings so an incoming call would be forced to use calling plan. Thanks for the education and help.

Gerry

T

1 Like