[Asterisk-Dev] PATCH: problem with incoming SIP INVITE with no comment-part in the From URI

Stephen Davies steve at daviesfam.org
Sun Jun 8 06:09:08 MST 2003


Hi,

Small patch to fix a problem with incoming SIP calls where there is no
comment-part (name) in the incoming From field.

I think this can be improved by taking the username part of the URI -
for calls from P8, at least, this contains the source phone number.

Anyway - this patch at least fixes the basic problem.

Steve

-------------- next part --------------
Index: channels/chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.119
diff -u -r1.119 chan_sip.c
--- channels/chan_sip.c	6 Jun 2003 00:06:52 -0000	1.119
+++ channels/chan_sip.c	8 Jun 2003 13:21:38 -0000
@@ -3322,11 +3327,12 @@
 	}
 	return 0;
 }
+
 static char *get_calleridname(char *input,char *output)
 {
 	char *end = strchr(input,'<');
 	char *tmp = strchr(input,'\"');
-	if (!end) return NULL;
+	if (!end || (end==input)) return NULL;
 	/* move away from "<" */
 	end--;
 	/* we found "name" */


More information about the asterisk-dev mailing list