From: Michael L. Young Date: Mon, 5 Aug 2013 20:19:41 +0000 (+0000) Subject: Fix Registration Failure When A Peer And TLS Are Used X-Git-Tag: 11.6.0-rc1~3^2~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e03a508781ea6cf8b1476088a500a6ef6327df5;p=thirdparty%2Fasterisk.git Fix Registration Failure When A Peer And TLS Are Used If a peer is used in a register line and TLS is defined as the transport, the registration fails since the transport on the dialog is never set properly resulting in UDP being used instead of TLS. This patch sets the dialog's transport based on the transport that was defined in the register line. If the register line does not specify a transport, the parsing function for the register line always defaults back to UDP. (closes issue ASTERISK-21964) Reported by: Doug Bailey Tested by: Doug Bailey Patches: asterisk-21964-set-reg-dialog-transport.diff by Michael L. Young (license 5026) ........ Merged revisions 396240 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@396248 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index bd65145077..41a33c78c5 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -15159,6 +15159,8 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char * append_history(p, "RegistryInit", "Account: %s@%s", r->username, r->hostname); } + p->socket.type = r->transport; + /* Use port number specified if no SRV record was found */ if (!ast_sockaddr_isnull(&r->us)) { if (!ast_sockaddr_port(&r->us) && r->portno) {