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

David Vossel dvossel at digium.com
Thu May 14 17:39:42 CDT 2009


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

(Updated 2009-05-14 17:39:42.540935)


Review request for Asterisk Developers.


Changes
-------

UPDATE: If the peer registers with a transport type other than the default, and the registration expires, the original default transport type is now restored.


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 (updated)
-----

  /trunk/configs/sip.conf.sample 194526 
  /trunk/channels/chan_sip.c 194526 

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