I need to configure a SIP Trunk with different SIP Signaling IP and SIP Media IP

I need to configure a SIP Trunk with different SIP Signaling IP and SIP Media IP

Vendor has given me following settings,

SMSC = 192.168.224.194
SIP Server Signaling = 192.168.224.195
SIP Server Media = 192.168.224.196
SBC Node IP = 192.168.224.197

I have set following settings in my sip.conf,

[SIPTrunk1]
type=peer
context=ext-agents
host=192.168.224.195
allow=all
port=5060
insecure=very
qualify = yes
nat=force_rport,comedia
relaxdtmf = yes
progressinband = yes
canreinvite = no

Trunk has been established but no voice is being heard on both side.

Vendor says I have to set SIP Server Media IP.

Please help me to resolve the issue.

The media address is negotiated in SDP on a call by call basis. There is no ability to set a remote media address.

1 Like

Then how can no voice issue can be resolved.

You’d need to actually identify the underlying problem. Have you checked the SIP/SDP (sip set debug on) to see where it says to send media? Have you checked “rtp set debug on” to see if the media is being sent? Have you done a packet capture to examine traffic?

I’d also note that you have NAT enabled for that peer, meaning that Asterisk will send media to where media was received from - which may differ from what was in the SDP and cause a problem.

Now i have disabled nat.

after rtp set debug on,

I get following message,

Got RTP packet from 192.168.224.196:39212 (type 00, seq 048578, ts 3864385328, len 000160)
Sent RTP packet to 172.29.108.4:39212 (type 00, seq 051913, ts 098560, len 000160)

Do the IP addresses look right? Have you confirmed you are receiving media from both sides and that it is being sent to the right location?

As per vendor,

Servers Private IP Address Natted P Address exposed to Tech Services
SIP Server Media 172.29.108.4 192.168.224.196
Servers Private IP Address Natted P Address exposed to Tech Services
SMSC 172.31.219.87 192.168.224.194
SIP Server Signaling 172.29.108.3 192.168.224.195
SIP Server Media 172.29.108.4 192.168.224.196
SBC Node IP 172.29.108.42 192.168.224.197

I’m asking you to do some analysis and trouble shooting yourself using the data you have, instead of relying on me and this forum.

I have been doing since last 2 days. No luck on any forum.

I have never setup a SIP trunk with different IPs. Usually I have single IP.

I have open sip debugging,

Audio is at 13278
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— SIP read from UDP:192.168.224.195:9133 —>
INVITE sip:3377333999@192.168.224.225:5060 SIP/2.0
Via: SIP/2.0/UDP 172.29.108.3:9133;branch=z9hG4bKbh0iis2qg1h0sosyss0rub5s5T41132
Call-ID: isbch4iyh2zzb0go1b45u241gr0g0b0i244z@10.18.5.64
From: "3320297051"sip:3320297051@192.168.224.225;transport=udp;user=phone;tag=sbc0405r22o2oh4-CC-1087-OFC-90
To: "3377333999"sip:3377333999@192.168.224.225;transport=udp;user=phone;tag=as6ba40ccf
CSeq: 2 INVITE
Max-Forwards: 70
Contact: sip:172.29.108.3:9133
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,INFO,PRACK,NOTIFY,MESSAGE
Supported: timer
Content-Length: 192
Content-Type: application/sdp

v=0
o=- 1074043495 1074043497 IN IP4 172.29.108.4
s=SBC call
c=IN IP4 172.29.108.4
t=0 0
m=audio 41320 RTP/AVP 0 116
a=rtpmap:0 PCMU/8000
a=rtpmap:116 telephone-event/8000
a=ptime:20
<------------->
— (12 headers 9 lines) —
Sending to 192.168.224.195:9133 (NAT)
Found RTP audio format 0
Found RTP audio format 116
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 116
Capabilities: us - (ulaw|alaw|gsm), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 172.29.108.4:41320

In the SDP you’ve provided it states that Asterisk should send audio to 172.29.108.4. There is no configuration to override this, except for the nat option which will cause Asterisk to send to the source address instead.

It’s also giving a 172 address as the contact address, so you will need routing for that RFC 1918 network as well as the 192 one, or you will not be able to hang up the call from your end.

The ITSP needs to get their house in order.

I am able to hangup call but no audio. What should I ask my vendor to do?

Properly describe their network configuration, such that you understand why they are expecting you to use two different private use networks.

I have already described network configuration.

Servers Private IP Address Natted P Address exposed to Tech Services
SMSC 172.31.219.87 192.168.224.194
SIP Server Signaling 172.29.108.3 192.168.224.195
SIP Server Media 172.29.108.4 192.168.224.196
SBC Node IP 172.29.108.42 192.168.224.197

The Vendor is insisting that to define different IP of SIP Signaling and Media.

Anyone knows how to configure sip trunk in pjsip?

Missed that. I do not understand what purpose the 192 network serves, or what “Address exposed to Tech Services” means.

The ITSP has sent c=IN IP4 172.29.108.4 which means that Asterisk will use that as the media address without your having to do anything.

It has also sent Contact: sip:172.29.108.3:9133, which will be used as the signalling address. However it has sent the request from 192.168.224.195:9133 which is the “named [I]P address”, whatever that means.

Do you have a route t the 172 network?

As has already been said, you need to do nothing to have the correct remote addresses used when you are the UAS, as is the case here. All the addresses are communicated in the SIP request. Even when acting as UAC, you don’t need to do anything about the remote media address, as that is provided in the singalling.

Issue is resolved after adding

nat=force_rport,comedia
externip=192.168.224.225 --> My Server Public IP