Hi Folks,
How could I force my sip-router to send from a given port number?
Many thanks in advance,
On 07/08/2010 06:18 AM, Victor Pascual Avila wrote:
How could I force my sip-router to send from a given port number?
Given that sip-router listens on the address of the interface (IP:port) that you want to send from, which is a requirement, you can use force_send_socket():
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#force_send_soc...
Thanks Alex
On Thu, Jul 8, 2010 at 12:26 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 07/08/2010 06:18 AM, Victor Pascual Avila wrote:
How could I force my sip-router to send from a given port number?
Given that sip-router listens on the address of the interface (IP:port) that you want to send from, which is a requirement, you can use force_send_socket():
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#force_send_soc...
-- Alex Balashov - Principal Evariste Systems LLC 1170 Peachtree Street 12th Floor, Suite 1200 Atlanta, GA 30309 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/
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
2010/7/8 Alex Balashov abalashov@evaristesys.com:
On 07/08/2010 06:18 AM, Victor Pascual Avila wrote:
How could I force my sip-router to send from a given port number?
Given that sip-router listens on the address of the interface (IP:port) that you want to send from, which is a requirement, you can use force_send_socket():
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#force_send_soc...
But be caredull with in-dialog requests as by default they would use the "default" source port ;)
On 7/8/10 12:57 PM, Iñaki Baz Castillo wrote:
2010/7/8 Alex Balashovabalashov@evaristesys.com:
On 07/08/2010 06:18 AM, Victor Pascual Avila wrote:
How could I force my sip-router to send from a given port number?
Given that sip-router listens on the address of the interface (IP:port) that you want to send from, which is a requirement, you can use force_send_socket():
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#force_send_soc...
But be caredull with in-dialog requests as by default they would use the "default" source port ;)
if invite is received on one socket and forwarded using a different socket, then it should get 2 record-route headers so the within-dialog requests are using same sockets without anything else in config than loose_route and relay. Do you get it different?
Cheers, Daniel
2010/7/8 Daniel-Constantin Mierla miconda@gmail.com:
But be caredull with in-dialog requests as by default they would use the "default" source port ;)
if invite is received on one socket and forwarded using a different socket, then it should get 2 record-route headers so the within-dialog requests are using same sockets without anything else in config than loose_route and relay. Do you get it different?
I was wondering exactly the same (the double Route header present in in-dialog request) but I remember a thread in which there was some problem with it (most probably due to a bad configuration).
So yes, my fault, it works out-of-the-box :)
Thanks for the clarification.
Even if it didn't, just add your own RR header.
-- Alex Balashov - Principal Evariste Systems LLC 1170 Peachtree Street 12th Floor, Suite 1200 Atlanta, GA 30309 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/
On Jul 8, 2010, at 7:33 AM, Iñaki Baz Castillo ibc@aliax.net wrote:
2010/7/8 Daniel-Constantin Mierla miconda@gmail.com:
But be caredull with in-dialog requests as by default they would use the "default" source port ;)
if invite is received on one socket and forwarded using a different socket, then it should get 2 record-route headers so the within-dialog requests are using same sockets without anything else in config than loose_route and relay. Do you get it different?
I was wondering exactly the same (the double Route header present in in-dialog request) but I remember a thread in which there was some problem with it (most probably due to a bad configuration).
So yes, my fault, it works out-of-the-box :)
Thanks for the clarification.
-- Iñaki Baz Castillo ibc@aliax.net
On 7/8/10 2:07 PM, Alex Balashov wrote:
Even if it didn't, just add your own RR header.
when you know exactly the inbound/outbound interfaces, yes you can add yourself the rr headers with textops and don't call rr.
rr has the advantage of adding the rr with outbound local IP in cases such as location and mhomed, when is not easy to decide in config which local socket to use for sending.
Cheers, Daniel
-- Alex Balashov - Principal Evariste Systems LLC 1170 Peachtree Street 12th Floor, Suite 1200 Atlanta, GA 30309 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/
On Jul 8, 2010, at 7:33 AM, Iñaki Baz Castillo ibc@aliax.net wrote:
2010/7/8 Daniel-Constantin Mierla miconda@gmail.com:
But be caredull with in-dialog requests as by default they would use the "default" source port ;)
if invite is received on one socket and forwarded using a different socket, then it should get 2 record-route headers so the within-dialog requests are using same sockets without anything else in config than loose_route and relay. Do you get it different?
I was wondering exactly the same (the double Route header present in in-dialog request) but I remember a thread in which there was some problem with it (most probably due to a bad configuration).
So yes, my fault, it works out-of-the-box :)
Thanks for the clarification.
-- Iñaki Baz Castillo ibc@aliax.net
On 07/09/2010 05:48 AM, Daniel-Constantin Mierla wrote:
On 7/8/10 2:07 PM, Alex Balashov wrote:
Even if it didn't, just add your own RR header.
when you know exactly the inbound/outbound interfaces, yes you can add yourself the rr headers with textops and don't call rr.
rr has the advantage of adding the rr with outbound local IP in cases such as location and mhomed, when is not easy to decide in config which local socket to use for sending.
True. I certainly agree it would be less convenient.
Victor: another way to do this, especially if you need to use pseudovariable arguments (which force_send_socket()) does not take) is to use $fs:
http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:3.0.x#forced_socke...
I often fiddle with $fs in branch routes...