[asterisk-dev] [Code Review] SIP various transport type issues
vadim at mbdsys.com
vadim at mbdsys.com
Mon Jun 8 20:30:21 CDT 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/278/#review836
-----------------------------------------------------------
/trunk/channels/chan_sip.c
<http://reviewboard.digium.com/r/278/#comment2044>
Shouldn't it be:
if (p->socket.type == SIP_TRANSPORT_UDP)
?
/trunk/channels/chan_sip.c
<http://reviewboard.digium.com/r/278/#comment2045>
Ditto
/trunk/channels/chan_sip.c
<http://reviewboard.digium.com/r/278/#comment2047>
This idiom is used pretty often
maby we should:
#define ao2_unref(o) { ao2_ref(o, -1); o = NULL; }
/trunk/channels/chan_sip.c
<http://reviewboard.digium.com/r/278/#comment2046>
This and code at line 23141 seems to be exactly the same.. Good candidate for factorisation
- vadim
On 2009-06-08 18:38:22, David Vossel wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/278/
> -----------------------------------------------------------
>
> (Updated 2009-06-08 18:38:22)
>
>
> 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