[asterisk-bugs] [JIRA] (ASTERISK-21964) SIP TLS Register statement fails if sip.conf register directive uses peer name.

Michael L. Young (JIRA) noreply at issues.asterisk.org
Wed Jun 26 16:30:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=207524#comment-207524 ] 

Michael L. Young edited comment on ASTERISK-21964 at 6/26/13 4:28 PM:
----------------------------------------------------------------------

I think it might be as simple as the following one-liner patch.  [^asterisk-21964-set-reg-dialog-transport.diff]

Basically same idea as the patch you put in the description but since the registry transport is always set (either the default UDP or based on parsing the register line), it might be simplified to just setting the transport on the dialog without the conditionals being necessary.  Let me know how if it works for you.
                
      was (Author: elguero):
    I think it might be as simple as the following one-liner patch.  [^asterisk-21964-set-reg-dialog-transport.diff]

Let me know how if it works for you.
                  
> SIP TLS Register statement fails if sip.conf register directive uses peer name. 
> --------------------------------------------------------------------------------
>
>                 Key: ASTERISK-21964
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21964
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/Registration
>    Affects Versions: 1.8.22.0
>            Reporter: Doug Bailey
>         Attachments: asterisk-21964-set-reg-dialog-transport.diff
>
>
> I am using 1.8.15-cert2 and have been testing some TLS functionality.  When I set a register statement that specifies TLS and uses the peer name as the target address in the register statement, I get an error and the register request never goes out.
> The problem occurs due to a create_addr failing in transmit_register due to an allocated dialog's socket being set to UDP while the sip_registry indicates only TLS transport.
> The register statement works if I explicitly specify the IP address in the sip.conf register statement.
> From sip.conf
> {noformat}
> register => tls://dbt:1234@dbt
> [dbt]
> type=peer
> host=192.168.88.44
> username=dbt
> defaultuser=dbt
> secret=1234
> transport=tls
> context=doug
> disallow=all
> allow=ulaw
> directmedia=no
> {noformat}
> Error encountered:
> {noformat}
> [Jun 26 10:43:47] ERROR[9054]: chan_sip.c:5342 create_addr_from_peer: 'UDP' is not a valid transport for 'dbt'. we only use 'TLS'! ending call.
> [Jun 26 10:43:47] WARNING[9054]: chan_sip.c:13524 transmit_register: Probably a DNS error for registration to dbt at dbt, trying REGISTER again (after 20 seconds)
> {noformat}
> If I make the following change, the register statement succeeds:
> {noformat}
> --- channels/chan_sip.c	(revision 392897)
> +++ channels/chan_sip.c	(working copy)
> @@ -13484,7 +13484,11 @@
>  			ast_log(LOG_WARNING, "Unable to allocate registration transaction (memory or socket error)\n");
>  			return 0;
>  		}
> -
> +		if (SIP_TRANSPORT_TLS == r->transport || SIP_TRANSPORT_TCP == r->transport ) {
> +			p->socket.type = r->transport;
> +		}
> +
> {noformat}
> This occurs both in 1.8.15-cert2 and in the tip of the 1.8 branch. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list