Hello,

changing the R-URI (sip address in the first line of request) can be done with varables:

  - $ru - the entire r-uri
  - $rd - only the domain part of r-uri

Cheers,
Daniel

On 14/01/16 23:25, Ryan Mottley wrote:
Hi,

We're running a system with Kamailio running in front of Asterisk just handling registrations and forwarding everything else to Asterisk. But we're having an issue during hangup on incoming calls. If the initiator hangs up, the call completes successfully. But if one of our phones hangs up, the BYE message comes back with a 404 "Not Found" and the call doesn't hang up on the carrier side.

According to the carrier, it's because the IP in the contact on our ACK message goes to their audio IP while the header of our BYE points to their signaling IP. 

ACK sip:[Kamailio Pub IP]:5060;line=sr--rkpsDAp6YAp6DIpZDZmZeI2ZYI26YIRVDcpsDIpsem* SIP/2.0
Via: SIP/2.0/UDP [Carrier Signaling IP];branch=z9hG4bK2236.1402e7b4.2
Via: SIP/2.0/UDP [Carrier Audio IP];received=[Carrier Audio IP];branch=z9hG4bK07a8bccb;rport=5060
Route: <sip:[Kamailio Pub IP];r2=on;lr=on;ftag=as67cef00d;nat=yes>,<sip:10.120.0.1;line=sr--rkpsDthVDIhVDNh6Ogo6eKh6eAQs4LRflC2srQRflC2srGqAl-CAP6rZrZkGDmpGed2APtCvlx1>
From: "+16014477389" <sip:6014477389@[Carrier Audio IP]>;tag=as67cef00d
To: <sip:6016025063@[Carrier Signaling IP]>;tag=as643b40ca
Contact: <sip:6014477389@[Carrier Audio IP]>
Call-ID: 4aaefec90826a2a221f0af9500ad211b@[Carrier Audio IP]
CSeq: 102 ACK
User-Agent: packetrino
Max-Forwards: 69
Content-Length: 0

BYE sip:6014477389@[Carrier Signaling IP] SIP/2.0
Via: SIP/2.0/UDP [Kamailio Pub IP];branch=z9hG4bK2236.fca983a45913fb510f97e781a85c7392.0
Via: SIP/2.0/UDP 10.120.0.1;branch=z9hG4bKsr-IqktV1L26BCx0jmwZeI2ZYI26YIRVDcpsDIpsem.-EF8-EtCZYmg6edIMehhA4A.AEzyuiZKfPKo7N-qAcWq6D-rsYc4Zp**
Route: <sip:[Carrier Signaling IP];lr=on>
Max-Forwards: 69
From: <sip:6016025063@[Kamailio Pub IP]>;tag=as643b40ca
To: "+16014477389" <sip:6014477389@[Carrier Audio IP]>;tag=as67cef00d
Call-ID: 4aaefec90826a2a221f0af9500ad211b@[Carrier Audio IP]
CSeq: 102 BYE
User-Agent: Asterisk PBX 13.6.0
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0

I'm thinking it's happening because their side isn't configured correctly to handle traffic coming back from a proxy, but in the meantime is there a way to rewrite the top of the BYE header to match the "audio IP" they're requesting it be sent to?

Thanks!

--
Ryan Mottley, Developer
VOXO, LLC
voxo.co - (601)602-5063


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu