Re: Adding rport to outbound SIP INVITE

Martin Nyström via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <AS8PR02MB780185AF9C7492D5435BCA1BF601A@AS8PR02MB7801.eurprd02.prod.outlook.com>
Thank you,

That seems to have solved the issue using add_local_rport 😊



/M

From: Daniel-Constantin Mierla <[email protected]>
Date: Tuesday, 2 September 2025 at 18:18
To: Kamailio (SER) - Users Mailing List <[email protected]>
Cc: Martin Nyström <[email protected]>
Subject: Re: [SR-Users] Adding rport to outbound SIP INVITE

CAUTION: This email originated from outside the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hello,

see:

- https://www.kamailio.org/wikidocs/cookbooks/6.0.x/core/#add_local_rport
- https://www.kamailio.org/wikidocs/cookbooks/6.0.x/core/#local_rport

However, for receiving new SIP requests, the AWS gateway should do 1-to-1 port forwarding (not necessary 5060) that the remote UA has to be aware of. In such case, the parameter listen with advertise has to be set.

Cheers,
Daniel

On 02.09.25 18:08, Martin Nyström via sr-users wrote:
Hi,

Is it possible to add rport to the top Via for the outbound INVITE? The Kamailio be behind an AWS NAT Gateway and we’re having the issue with the provider not replying to the source port but instead 5060. From what I have understood if we add the rport; without value in the Via it will tell the receiver to reply to the source ip and port.

Here’s the route block for calls sent to the PSTN.

route[PSTN] {

                ds_select_dst(1, 4);

                force_rport();

                record_route();

                t_on_failure("FAILURE_PROVIDER");

                route(RELAY);
                exit;

}


The outbound invite towards PSTN looks like this, missing rport in the top Via

INVITE sip:[email protected]<mailto:sip:[email protected]> SIP/2.0
Record-Route: <sip:10.3.130.39:5060;lr;ftag=b9827f5a-fef3-42f6-b8a4-aded67374bfb;lr;vsf=AAAAAAAAAAAAAAAAAAAAAAABFhMACBBKBhFDQhMBQhgBSggVQQ8SQAEWBk8ACm5uZWN0ZWwuYXBw>
Via: SIP/2.0/UDP sbc.coolcompany.com:5060;branch=z9hG4bK350f.eb699686bbd2c208bd77d3d92fd5ed55.0
Via: SIP/2.0/UDP 10.2.8.34:5060;received=10.2.8.34;rport=5060;branch=z9hG4bKPj405acf54-c51d-4681-a7c7-9774ee63e219
From: <sip:[email protected]:5060><mailto:sip:[email protected]:5060>;tag=b9827f5a-fef3-42f6-b8a4-aded67374bfb
To: <sip:+4670xxxxxx@xxxxxxxx>
Contact: xxxx
Call-ID: bba640af-369e-4a6c-b5ec-3974919d98c9
CSeq: 5899 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 69
User-Agent: Voice SBC
Content-Type: application/sdp
Content-Length:   310



/M



__________________________________________________________

Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]<mailto:[email protected]>

To unsubscribe send an email to [email protected]<mailto:[email protected]>

Important: keep the mailing list in the recipients, do not reply only to the sender!



--

Daniel-Constantin Mierla (@ asipto.com)

twitter.com/miconda -- linkedin.com/in/miconda

Kamailio Consultancy, Training and Development Services -- asipto.com

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.