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

David Vossel dvossel at digium.com
Thu May 21 12:04:58 CDT 2009


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

(Updated 2009-05-21 12:04:58.609652)


Review request for Asterisk Developers.


Changes
-------

The last patch only reset the default transport type for a peer when the registration expired.  This new one resets the transport type when the peer Unregisters as well.  I thought the same logic was used for both Unregistering and registration expiration, but I was wrong.


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/channels/chan_sip.c 195948 
  /trunk/configs/sip.conf.sample 195948 

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