Asterisk registration with two trunks, only 1 is working

I am using asterisk ( ver 13.10.0.0) as a very simple PBX. I have two trunks I want it to register with and make/accept sip calls to/from.

My config works for each single trunk but when I combined them only 1 trunk shows in the ‘show sip peers’ output. BTW I have inherited this setup so am still learning about asterisk and sip.
The switches the PBX is registering to shows each show a succesful registration.
ie switch 1 & switch 2 both think PBX is registered succesfully.
Calls from a switch that thinks PBX is registered with but PBX disagrees fail.
My SIP.conf is below:-

Starting with a simple question, should this work with two trunks okay ?or am i chasing a white elephant ?
Assuming it should work, any suggestions what is wrong ?


SIP.conf

; *****************************************************
; ** General Section - thing in here APPLY GLOBALLY! **
; *****************************************************

; --------------------------------------------------
; – stage 1 goal –
; – –
; – we want the phones to bind to 5060 –
; – we want The Shout server to bind to 5061 –
; --------------------------------------------------

[general]
context=public
; ---------------------------------------------------------
; – listen for fixed phone SIP connections on port 5060 –
; ---------------------------------------------------------
udpbindport=5060
bindaddr=10.92.160.5
svrlookup=yes
#include “/etc/asterisk/sip.extensions.conf”
; *****************************************
; ** end of GENERAL section **
; *****************************************
; --------------------------------------------------------------
; – now we must bind port 5061 for TLS on the same Interface –
; --------------------------------------------------------------
;[authentication]

tlsenable=yes ; Enable server for incoming TLS (secure) connections (default is no)
tlsbindaddr=10.154.160.5:5061
srvlookup=yes
defaultexpiry=300

tlscertfile=/etc/asterisk/keys/asterisk.pem ; Certificate chain (.pem format only) to use for TLS connections
tlsprivatekey=/etc/asterisk/keys/asterisk_private.pem ; Private key file (
.pem format only) for TLS connections.
tlscafile=/etc/asterisk/keys/calist.pem
tlsdontverifyserver=yes
tlscipher=ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:
@STRENGTH
tlsclientmethod=tlsv1.2
; *********************************
; ** RTP SECTION **
; *********************************
rtptimeout=30 ; Terminate call if 30 seconds elapse with no RTP
;
; ********************************
; ** OUTBOUND SIP REGISTRATIONS **
; ********************************
register => tls://pbx:pbx@10.92.82.2:5061 ;Switch 1
register => tls://pbx:pbx@10.92.82.3:5061 ;SWitch 2
; *******************************************************
; ** INBOUND SIP PEER SWITCH 1 DEFINITION **
; *******************************************************
[ShoutGW]
nat=yes
type=friend
host=10.92.82.2
port=5061
defaultuser=pbx
secret=pbx
context=public
insecure=invite,port
transport=tls
disallow=all
allow=alaw,ulaw
encryption=yes
directmedia=no
tlsdontverifyserver=yes
; *******************************************************
; ** INBOUND SIP PEER REF B SHOUT SWITCH 2 DEFINITION **
; *******************************************************
[ShoutGW2]
nat=yes
type=friend
host=10.92.82.3
port=5061
defaultuser=pbx
secret=pbx
context=public
insecure=invite,port
transport=tls
disallow=all
allow=alaw,ulaw
encryption=yes
directmedia=no
tlsdontverifyserver=yes


Please provide the logs from the time at which it is parsing sip.conf, as none of the obvious problems would result in one section being ignored.

(The obvious problems are the ones typically seen with cut and paste configurations and tend not to crate functional failures in most cases, but I would suggest re-evaluating nat, type, and insecure, from first principles.)

Will do thanks, is that logs in directory below:
/var/log/asterisk

Connecting to two switches in this manner should work shouldn’t it ?

You have distinct IP addresses for them, so it should work I can’t see anything that would result in their not being shown in peers.

Briliant thanks, I’ll get the logs and see what they tell.

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