[asterisk-dev] [Code Review] SIP various transport type issues

David Vossel dvossel at digium.com
Mon Jun 8 18:38:23 CDT 2009


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

Review request for Asterisk Developers.


Summary
-------

This is a combination of patches from vrban, mmichelson, and myself relating to (issue #13865).

What this patch addresses:

1. ast_sip_ouraddrfor() by default binds to the UDP address/port reguardless if the sip->pvt is of type UDP or not.  Now when no remapping is required, ast_sip_ouraddrfor() checks the sip_pvt's transport type, attempting to set the address and port to the correct TCP/TLS bindings if necessary.

2.  It is not necessary to send the port number in the Contact header unless the port is non-standard for the transport type.  This patch fixes this and removes the todo note.

3.  In sip_alloc(), the default dialog built always uses transport type UDP.  Now sip_alloc() looks at the sip_request (if present) and determines what transport type to use by default.

4.  When changing the transport type of a sip_socket, the file descriptor must be set to -1 and in some cases the tcptls_session's ref count must be decremented and set to NULL.  I've encountered several issues associated with this process and have created a function, set_socket_transport(), to handle the setting of the socket type.


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


Diffs
-----

  /trunk/channels/chan_sip.c 199297 

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


Testing
-------

It appears through issue notes that vrban has tested items 1-3.  I have only reviewed/cleaned up a few possible errors and done sanity checks on them.  I have tested item 4.  The function was previously used only for changing a peer's transport type.  I simply expanded it to be used every time any socket's transport type is changed


Thanks,

David




More information about the asterisk-dev mailing list