[Asterisk-cvs] asterisk/channels chan_sip.c,1.262,1.263

markster at lists.digium.com markster at lists.digium.com
Sat Dec 13 17:03:06 CST 2003


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

Modified Files:
	chan_sip.c 
Log Message:
The SIP motto is "There's More Than One Standard for Doing It"


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.262
retrieving revision 1.263
diff -u -d -r1.262 -r1.263
--- chan_sip.c	9 Dec 2003 22:09:05 -0000	1.262
+++ chan_sip.c	13 Dec 2003 22:54:37 -0000	1.263
@@ -1845,6 +1845,7 @@
 	struct hostent *hp;
 	int codec;
 	int iterator;
+	int sendonly = 0;
 	int x;
 
 	/* Get codec and RTP info from SDP */
@@ -1925,6 +1926,13 @@
 	sdpLineNum_iterator_init(&iterator);
 	while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
       char* mimeSubtype = ast_strdupa(a); // ensures we have enough space
+	  if (!strcasecmp(a, "sendonly")) {
+	  	sendonly=1;
+		continue;
+	  }
+	  if (!strcasecmp(a, "sendrecv")) {
+	  	sendonly=0;
+	  }
 	  if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) continue;
 	  if (sipdebug)
 		ast_verbose("Found description format %s\n", mimeSubtype);
@@ -1963,7 +1971,7 @@
 		}
 		if (p->owner->bridge) {
 			/* Turn on/off music on hold if we are holding/unholding */
-			if (sin.sin_addr.s_addr) {
+			if (sin.sin_addr.s_addr && !sendonly) {
 				ast_moh_stop(p->owner->bridge);
 			} else {
 				ast_moh_start(p->owner->bridge, NULL);




More information about the svn-commits mailing list