Trunk SIP allow communicate only one extension

Hi to all:

I have 2 peers:

[central1]
type=peer
qualify=yes
host=200.114.xxx.xxx
port=5060
nat=yes
context=from-trunk
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=alaw, ulaw
insecure=very
allowguest=yes

[central2]
type = peer
context = from_central2
host = 181.168.xxx.xxx
dtmfmode = rfc2833
qualify=yes
canreinvite = no
insecure=port,invite
nat=yes
disallow = all
allow = alaw,ulaw
trunk=yes

When I tray to call from central2 to central1 from internal 100 (in central1) I have no problems
All other extensions from central1 can’t call with this error:

SIP/2.0 401 Unauthorized

We’re going to need more than this. The sentence isn’t internally consistent. Logs of a failed call will probably help.

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug?src=contextnavpagetreemode

https://pastebin.com/w2shgGYz

https://pastebin.com/EDQQYyDE

The first log is not debug, the second is from full log

People need to stop connecting TWO PBX SYSTEMS WITH THE SAME EXTENSION RANGES.

[2018-10-11 18:27:18] DEBUG[3555] chan_sip.c: Header 3 [ 58]: From: “interno 104” <sip:[email protected]>;tag=as72b98865
[2018-10-11 18:27:18] DEBUG[3555] chan_sip.c: Header 4 [ 28]: To: <sip:[email protected]
.xxx>
[2018-10-11 18:27:18] DEBUG[3555] chan_sip.c: Header 5 [ 37]: Contact: <sip:[email protected]:5060>

You cannot blindly call 104 on PBX A from 104 (or anything other extension on PBX A) from PBX B. When 104 from PBX B calls 104 on PBX A, PBX A is going to go “Oh 104 is attempting to send me a call, let me check their username/IP and auth them” expect since the IPs are going to be different and the auth isn’t going to work, you get no call.

When you connect multiple PBX systems together that have “overlapping” extensions, you need to make each PBX present calls so they don’t seem like they are coming from an extension that exists locally and the PBX rejects it due to it looking like a bad attempt.

Yes! It’s true.
Thanx.

My problem is that I have no control over Central2 neither can change the numbers in Central1

How can modify the incomming number from central2 for avoid this problem?

It’s going to take some work and custom dialplan.

  1. You need to make the outgoing part for each of the PBX trunks present a unique “fromuser” so it doesn’t use the callers default “fromuser” (aka 104) but you also need to present the callers information via RPID or PAI so it can be seen in the CallerID.

  2. You need to set the context on each trunk to something else besides “from-internal” so you can intercept it and deal with accepting the call then routing it back to the generated dialplan to call the extension.

Oh if you can’t make the needed changes on Central2, then you’re pretty much dead in the water. This can’t be a one sided fix. All PBXes involved need to be updated to deal with this.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.