[asterisk-dev] Problem with branch 1.2 r38420 - /branches/1.2/channels/chan_sip.c

asterisk at ntplx.net asterisk at ntplx.net
Sat Jul 29 15:29:51 MST 2006


This update causes call failures now (for me anyway).
SIP calls from phones always fails to know what I'm calling and
drops to invalid.

It's in this section of chan_sip.c

>  	/* Skip any options */
>  	if ((a = strchr(uri, ';'))) {
> +		*a++ = '\0';
> +		b = a;
> +	} else {
> +		b = uri;
> +	}
> +
>  	/* Get the target domain */
> +	if ((a = strchr(b, '@'))) {
> +		*a++ = '\0';
>  	} else {	/* No username part */
> +		a = b;
>  		uri = "s";	/* Set extension to "s" */
>  	}

The issue is in the To:
  To: <sip:310 at asterisk;user=phone>;tag=xxxxx
It starts looking for the @ in the "user=phone" part.....

Or whatever....it still fails now. Always setting "b=uri" makes it work.

Quoting svn-commits at lists.digium.com:

> Author: file
> Date: Fri Jul 28 13:49:00 2006
> New Revision: 38420
>
> URL: http://svn.digium.com/view/asterisk?rev=38420&view=rev
> Log:
> Make a copy of the request URI in check_user_full instead of modifying the
> one on the structure, and also strip params properly from the user portion of
> the SIP URI so as to preserve the domain (issue #7552 reported by dan42)
>
> Modified:
>     branches/1.2/channels/chan_sip.c
>
> Modified: branches/1.2/channels/chan_sip.c
> URL:
>
http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=38420&r1=38419&r2=38420&view=diff
> ==============================================================================
> --- branches/1.2/channels/chan_sip.c (original)
> +++ branches/1.2/channels/chan_sip.c Fri Jul 28 13:49:00 2006
> @@ -6633,7 +6633,7 @@
>  /*! \brief  get_destination: Find out who the call is for --*/
>  static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
>  {
> -	char tmp[256] = "", *uri, *a;
> +	char tmp[256] = "", *uri, *a, *b;
>  	char tmpf[256], *from;
>  	struct sip_request *req;
>  	char *colon;
> @@ -6670,15 +6670,17 @@
>
>  	/* Skip any options */
>  	if ((a = strchr(uri, ';'))) {
> -		*a = '\0';
> -	}
> -
> +		*a++ = '\0';
> +		b = a;
> +	} else {
> +		b = uri;
> +	}
> +
>  	/* Get the target domain */
> -	if ((a = strchr(uri, '@'))) {
> -		*a = '\0';
> -		a++;
> +	if ((a = strchr(b, '@'))) {
> +		*a++ = '\0';
>  	} else {	/* No username part */
> -		a = uri;
> +		a = b;
>  		uri = "s";	/* Set extension to "s" */
>  	}
>  	colon = strchr(a, ':'); /* Remove :port */





More information about the asterisk-dev mailing list