On multiple peers

Hello,

On multiple sip peers , the inbound calls are not routed on inbound peers.

I have multiple peers for single provider for inbound and outbound .

I have peers with
[provider2]
type=peer
host=192.168.2.17
trustrpid=yes
context=main
insecure=port,invite
dtmfmode=auto
canreinvite=yes
directrtpsetup=yes
disallow=all
allow=g729
allow=ulaw

and multiple peers for outbound with:

[provider1]
type=peer
host=192.168.2.17
username=1xxxxx
fromuser=1xxxxx
secret=abcd
qualify=yes
trustrpid = yes
sendrpid = yes
context=main
;insecure=very
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=alaw
allow=g729

Below is the debug for inbound call :-

<— SIP read from UDP:192.168.2.17:5060 —>
INVITE sip:6468107006@192.168.2.12:5060;transport=udp SIP/2.0
Record-Route: sip:192.168.2.17;lr=on;ftag=gK0614a89e;nat=yes;did=58c.feb03954
Record-Route: sip:192.168.2.4;lr=on;ftag=gK0614a89e
Record-Route: sip:192.168.2.202;lr;ftag=gK0614a89e
Record-Route: sip:192.168.2.93;lr=on;ftag=gK0614a89e
Via: SIP/2.0/UDP 192.168.2.17;branch=z9hG4bKc25b.882edcb.0
Via: SIP/2.0/UDP 192.168.2.4;branch=z9hG4bKc25b.b114d814.0
Via: SIP/2.0/UDP 192.168.2.202;branch=z9hG4bKc25b.19d41002.0
Via: SIP/2.0/UDP 192.168.2.93;branch=z9hG4bKc25b.b3321286.0
Via: SIP/2.0/UDP 192.168.37.72:5060;branch=z9hG4bK06B9ff0474f0c48cad2
From: sip:1919322273640@abcd.net;tag=gK0614a89e
To: sip:+16468107006@192.168.2.93
X-Prov-Curr-id: 1
X-Route: 0
Call-ID: 872828565_132114977@192.168.37.72
CSeq: 7584 INVITE
Max-Forwards: 196
Contact: sip:+1919322273640@192.168.37.72:5060
Content-Length: 329
Content-Disposition: session; handling=required
Content-Type: application/sdp
Remote-Party-ID: sip:+1919322273640@192.168.37.72:5060;privacy=off
P-Asserted-Identity: sip:+1919322273640@192.168.37.72:5060

v=0
o=Sonus_UAC 25551 17919 IN IP4 192.168.37.72
s=SIP Media Capabilities
c=IN IP4 67.231.8.102
t=0 0
m=audio 28480 RTP/AVP 0 18 96 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:96 iLBC/8000
a=fmtp:96 mode=30
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:30
<------------->
— (23 headers 15 lines) —
Sending to 192.168.2.17:5060 (NAT)
Using INVITE request as basis request - 872828565_132114977@192.168.37.72
Found peer ‘SOFTSWITCH_NOVA’ for ‘1919322273640’ from 192.168.2.17:5060

<— Reliably Transmitting (NAT) to 192.168.2.17:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.2.17;branch=z9hG4bKc25b.882edcb.0;received=192.168.2.17;rport=5060
Via: SIP/2.0/UDP 192.168.2.4;branch=z9hG4bKc25b.b114d814.0
Via: SIP/2.0/UDP 192.168.2.202;branch=z9hG4bKc25b.19d41002.0
Via: SIP/2.0/UDP 192.168.2.93;branch=z9hG4bKc25b.b3321286.0
Via: SIP/2.0/UDP 192.168.37.72:5060;branch=z9hG4bK06B9ff0474f0c48cad2
From: sip:1919322273640@abcd.net;tag=gK0614a89e
To: sip:+16468107006@192.168.2.93;tag=as3d2818dc
Call-ID: 872828565_132114977@192.168.37.72
CSeq: 7584 INVITE
Server: iPBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“192.168.2.12”, nonce="096817d1"
Content-Length: 0

Peers are routed on IP address.

One tactic is to have them all lead to one context, then further route them based on the dialed number.

You may need to use insecure=invite, if you cannot use the same credentials for both, or it is inappropriate to authenticated inbound, other than by IP address.

There are 3 peers of type provider1 and 1 peer of type provider2,
when calls is forwarded to asterisk from the inbound provider, it is getting rejected as the debug shown above.

Regards
Sam

It is not being rejected. It is simply being challenged to authenticate itself. I think, insecure=invite will get round that.

Is ‘SOFTSWITCH_NOVA’ provider 1 or provider 2?

Thanks, insecure=invite on all peers does the trick .