is there a flag that i can set before calling t_relay that causes t_relay not to try to create a new tcp connection to the destination if one does not already exist? this would be handy when t_relaying to registered tcp contacts.
-- juha
On Nov 16, 2009 at 23:46, Juha Heinanen jh@tutpro.com wrote:
is there a flag that i can set before calling t_relay that causes t_relay not to try to create a new tcp connection to the destination if one does not already exist? this would be handy when t_relaying to registered tcp contacts.
From the script, use set_forward_no_connect() before t_relay().
If you want to do this from a module, then use: msg->fwd_send_flags |=SND_F_FORCE_CON_REUSE.
See also set_reply_no_connect(), set_forward_close() and set_reply_close() (they are documented in NEWS and thanks to Klaus also in http://sip-router.org/wiki/cookbooks/core-cookbook/devel).
Andrei
On Tue, Nov 17, 2009 at 1:03 AM, Andrei Pelinescu-Onciul andrei@iptel.org wrote:
On Nov 16, 2009 at 23:46, Juha Heinanen jh@tutpro.com wrote:
is there a flag that i can set before calling t_relay that causes t_relay not to try to create a new tcp connection to the destination if one does not already exist? this would be handy when t_relaying to registered tcp contacts.
From the script, use set_forward_no_connect() before t_relay(). If you want to do this from a module, then use: msg->fwd_send_flags |=SND_F_FORCE_CON_REUSE.
See also set_reply_no_connect(), set_forward_close() and set_reply_close() (they are documented in NEWS and thanks to Klaus also in http://sip-router.org/wiki/cookbooks/core-cookbook/devel).
Note that you cannot reliably tell if a connection to a UA behind NAT can be established. For example, I have a Fritbox NAT at home which can be configured to "expose" one of the hosts to the internet. This means that all incoming traffic for which no other rule is found in the NAT box is forwarded to the exposed host, which in my case is a UA.
-- Jan
Jan Janak writes:
Note that you cannot reliably tell if a connection to a UA behind NAT can be established.
jan,
i'm not trying to determine that. i just don't see any point in even trying to establish tcp connection from proxy to an ua that has registered over tcp. the ua and proxy should not close the connection as long as registration is valid.
-- juha
On Tue, Nov 17, 2009 at 6:56 AM, Juha Heinanen jh@tutpro.com wrote:
Jan Janak writes:
> Note that you cannot reliably tell if a connection to a UA behind NAT > can be established.
jan,
i'm not trying to determine that. i just don't see any point in even trying to establish tcp connection from proxy to an ua that has registered over tcp. the ua and proxy should not close the connection as long as registration is valid.
I see, that makes sense.
-- Jan