SIP trunk between 2 PBX's

Hey Guys,

I need some help getting outbound calls working via two PBX servers running Asterisk.

The one i have complied from source, the dialplan is successfully calling the SIP peer which is my trunk.

The other PBX is running Elastix.

PEER DETAILS

THE PBX RUNNING FROM SOURCE:
[NAME- OUTBOUND]
disallow=all
host=XYZ
fromdomain=XYZ
type=peer
qualify=yes
allow=ulaw
allow=alaw
insecure=port,invite
canreinvite=no
context=outside

THE PBX RUNNING ELASTIX
host=XYZ
transport=udp
port=5060
fromdomain=XYZ
context=from-trunk
type=friend
qualify=yes
disallow=all
allow=alaw&ulaw

Now the peers are up and in an OK status, what makes me believe that it is not the actual trunk config is that i have inbound working from another PBX in our network, i have tried calls out through there also but same result. Both other PBX systems are working 100% - inbound and out. So i think there is something up with the box I have complied from source.

This is the messages i get from asterisk on the failed calls:

“Dial”,“SIP/XYZ”,“2019-07-29 14:47:06”,“2019-07-29 14:47:06”,0,0,“FAILED”,“DOCUMENTATION”,“1564411626.68”,""


Using SIP RTP CoS mark 5
> 0x7fbd5c06c4a0 – Strict RTP learning after remote address set to: IPADDY:41844
– Executing [NUMBER@phones:1] Goto(“SIP/andre-00000052”, “outgoing,0768329443,1”) in new stack
– Goto (outgoing,NUMBER,1)
– Executing [NUMBER@outgoing:1] Dial(“SIP/NAME-00000052”, “TRUNKNAME”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/TRUNKNAME
– Got SIP response 603 “Declined” back from ELASTIXPBX
– SIP/TRUNKNAME is busy
== Everyone is busy/congested at this time (1:1/0/0)
– Auto fallthrough, channel ‘SIP/NAME-00000052’ status is ‘BUSY’
PBX*CLI>

Thanks
Andre

What do the logs on the Elastix system say?

Why are you not sending any dialed digits?

What is the relevant part of the dialplan?

Why are you dialing TRUNKNAME, when the only trunk you have configured is called NAME-OUTBOUND?

Why are you using type=friend on the Elastix side?

The following are not likely to be causing you visible failures:

Why are you using insecure=invite when there is no secret?

Why are you using insecure=port when there is no obvious reason why hte port will ever be anything but 5060?

Why are you using canreinvite when that was renamed about a decade ago?

Why are you only explicitly disabling directmedia on one side?

Why are you setting fromdomain when nothing will be looking at it?

Hi David,

What do the logs on the Elastix system say?

I do not see the call in /var/log/asterisk/cdr-csv/Master.csv

Why are you not sending any dialed digits?

I’m forcing my phones that when they call my mobile to call out the trunk

What is the relevant part of the dialplan?

I’m forcing my phones that when they call my mobile to call out the trunk

Why are you dialing TRUNKNAME, when the only trunk you have configured is called NAME-OUTBOUND?

I have an inbound trunk also

Why are you using type=friend on the Elastix side?

What should i use?

The following are not likely to be causing you visible failures:

Why are you using insecure=invite when there is no secret?

I have amended this i tried adding a secret but forgot to take it out after this didnt work

Why are you using insecure=port when there is no obvious reason why hte port will ever be anything but 5060?

this has been amended.

Why are you using canreinvite when that was renamed about a decade ago?

This has been removed.

Why are you only explicitly disabling directmedia on one side?

What needs to change for this?

Why are you setting fromdomain when nothing will be looking at it?

This has been ammended

NEW TRUNK CONFIG

PBX FROM SOURCE
[CPTPBX01 - OUTBOUND]
disallow=all
host=IP
type=peer
qualify=yes
allow=ulaw
allow=alaw
context=outside

ELASTIX
host=IP
transport=udp
port=5060
context=from-internal
type=friend
qualify=yes
disallow=all
allow=alaw&ulaw

same result on the call

== Using SIP RTP CoS mark 5
– Called SIP/TRUNK NAME
– Got SIP response 603 “Declined” back from IP:5060
– SIP/TRUNK NAME-00000057 is busy
== Everyone is busy/congested at this time (1:1/0/0)
– Auto fallthrough, channel ‘SIP/andre-00000056’ status is ‘BUSY’

/var/log/asterisk/full, which should be enabled and a sutiable verbosity set.

Hi David

I dont see the call in that log file either :frowning: the only calls i see are the ones below and the time that i made the test call was at exactly 13:57

[2019-07-30 13:51:22] WARNING[2953][C-00017f4e] chan_sip.c: Received response: “Forbidden” from ‘“Unknown” sip:Unknown@IP;tag=as40c8be61’
[2019-07-30 14:00:32] WARNING[2953][C-00017f5a] chan_sip.c: Received response: “Forbidden” from ‘“Unknown” sip:Unknown@IP;tag=as58ce860c’

In that case, you are probably sending the request to a completely different SIP UAS!

But I’m specifying the host IP

In that case you don’t have an adequate logging level, as, the rejecting of an incoming call should always be logged.

Yea i understand that, any ideas where i can set that, its a bit weird that i do see calls in the full log file but not mine…

it has to be something local on my source asterisk PBX. I tried another PBX now and same result… Its not hitting that one also yet i can do incoming calls.

You should use sip set debug on to see exactly what you are receiving, and form where, but this is not a faked response, like timeouts are; something will have been received.