Multiple SIP Trunk Registration Issue

Hi,

I am sorry if this question has already been asked before. I searched a lot over the google but could not find the solution. Pro’lly I didnt search with right search terms.

I am newbee to Asterisk, I have run into a problem, where I have 2 SIP trunk providers.

The problem is I cannot connect them both simultaneously at the same time. I have to disable either one of them for the other to be connected.

sipgate.co.uk:5060 N 2125892 120 Unregistered

gw1.sip.us:5060 N 5248454447 105 Registered Mon, 02 Jun 2014 22:18:51

I am behind NAT and have following port binding
nat=yes
externip=mylivestaticip
localnet=192.168.1.0/255.255.255.0

SIP.US Trunk
Peer Details
username=myusername
type=peer
trustrpid=yes
session-timers=refuse
secret=mysecret
rfc2833compensate=yes
qualifyfreq=120
qualify=yes
nat=yes
insecure=port,invite
host=gw1.sip.us
fromdomain=gw1.sip.us
dtmfmode=rfc2833
disallow=all
context=from-trunk
canrevinvite=no
allow=ulaw

Register String: username:[email protected]/username

SIPGATE.CO.UK TRUNK
Peer Details
username=username
type=friend
secret=secret
qualify=yes
nat=yes
insecure=invite
host=sipgate.co.uk
fromuser=username
fromdomain=sipgate.co.uk
dtmfmode=rfc2833
disallow=all
context=from-sipgate
canreinvite=no
allow=ulaw&alaw

Register String: username:[email protected]/username

Can anyone please tell me what seems to be wrong at my end. Would appreciate all the help.

You have two insecure trunks. It doesn’t make much that you even need that directive since you are supplying a username and secret.

That should not affect registration.

Perhaps your router is not smart enough to handle two simultaneous SIP sessions.

Did you define a context [from-sipgate] , you will need that if you use it ?

Did you define a context [from-sipgate] ?, you will need that if you use it.

Thanks for your reply, but my router is already handlin another asterisk that has multiple trunks connected on 5060 and 5061.

Hi,

Yes I have defined context=from-sipgate in the trunk peer.

You don’t understand his question. The system does not know what from-sipgate is. Was that just something shown in an example?

You can’t make contexts up. They are the point calls enter the dial plan.

If you want the call to enter FreePBX I suggest you use from-trunk.