[asterisk-dev] [Code Review] SIP set outbound transport type from Registration

David Vossel dvossel at digium.com
Tue May 12 16:51:42 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/249/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

In sip.conf the transport option allows for the configuration of what transport types (udp, tcp, and tls) a peer will accept, but only the first type listed is used for outbound connections.

Example:
transport = tcp, udp (peer will accept tcp or udp inbound, but will only make outbound requests using tcp)

If the peer registers using UDP and specifies UDP in the Contact header, Asterisk currently forces all outbound requests to that peer to use TCP.

This patch fixes this.  Now the default transport type is only used until the peer registers.  When registration takes place the transport type is parsed out of the Contact header.  If the Contact header's transport type is equal to one that the peer supports, the peer's default transport type for outbound connections is set to match the Contact header's type.  If the Contact header's transport type is not present, then the peer's default transport type is set to match the one the peer registered with.


This addresses bug 0014727.
    https://issues.asterisk.org/view.php?id=0014727


Diffs
-----

  /team/dvossel/sip_via_tcp_rework/configs/sip.conf.sample 192938 
  /team/dvossel/sip_via_tcp_rework/channels/chan_sip.c 192938 

Diff: http://reviewboard.digium.com/r/249/diff


Testing
-------

tested using qualify and transport = tcp,udp.  Asterisk sends Options requests to a peer using tcp before the peer registers.  Once the peer registers using UDP Asterisk starts sending the Option requests using UDP.  Tested invites after registration as well, Asterisk uses UDP instead of TCP.


Thanks,

David




More information about the asterisk-dev mailing list