[Asterisk-cvs] asterisk/channels chan_sip.c,1.292.2.24,1.292.2.25

markster at lists.digium.com markster at lists.digium.com
Wed Mar 31 03:03:38 CST 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv7208/channels

Modified Files:
      Tag: v1-0_stable
	chan_sip.c 
Log Message:
Pass the opaque pointer as appropriate


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.292.2.24
retrieving revision 1.292.2.25
diff -u -d -r1.292.2.24 -r1.292.2.25
--- chan_sip.c	28 Mar 2004 17:18:59 -0000	1.292.2.24
+++ chan_sip.c	31 Mar 2004 08:02:08 -0000	1.292.2.25
@@ -253,6 +253,7 @@
 	char our_contact[256];				/* Our contact header */
 	char realm[256];				/* Authorization realm */
 	char nonce[256];				/* Authorization nonce */
+	char opaque[256];				/* Opaque nonsense */
 	char domain[256];				/* Authorization nonce */
 	char lastmsg[256];				/* Last Message sent/received */
 	int amaflags;						/* AMA Flags */
@@ -4681,6 +4682,7 @@
 	char *realm = "";
 	char *nonce = "";
 	char *domain = "";
+	char *opaque = "";
 	char *c;
 
 
@@ -4715,6 +4717,17 @@
 				if ((c = strchr(c,',')))
 					*c = '\0';
 			}
+		} else if (!strncasecmp(c, "opaque=", strlen("opaque="))) {
+			c+=strlen("opaque=");
+			if ((*c == '\"')) {
+				opaque=++c;
+				if ((c = strchr(c,'\"')))
+					*c = '\0';
+			} else {
+				opaque = c;
+				if ((c = strchr(c,',')))
+					*c = '\0';
+			}
 		} else if (!strncasecmp(c, "domain=", strlen("domain="))) {
 			c+=strlen("domain=");
 			if ((*c == '\"')) {
@@ -4738,6 +4751,7 @@
 	strncpy(p->realm, realm, sizeof(p->realm)-1);
 	strncpy(p->nonce, nonce, sizeof(p->nonce)-1);
 	strncpy(p->domain, domain, sizeof(p->domain)-1);
+	strncpy(p->opaque, opaque, sizeof(p->opaque)-1);
 	build_reply_digest(p, orig_header, digest, digest_len); 
 	return 0;
 }
@@ -4769,7 +4783,7 @@
 	snprintf(resp,sizeof(resp),"%s:%s:%s",a1_hash,p->nonce,a2_hash);
 	md5_hash(resp_hash,resp);
 
-	snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\"",p->peername,p->realm,uri,p->nonce,resp_hash);
+	snprintf(digest,digest_len,"Digest username=\"%s\", realm=\"%s\", algorithm=\"MD5\", uri=\"%s\", nonce=\"%s\", response=\"%s\", opaque=\"%s\"",p->peername,p->realm,uri,p->nonce,resp_hash, p->opaque);
 
 	return 0;
 }




More information about the svn-commits mailing list