[Asterisk-cvs] asterisk/channels chan_sip.c,1.427,1.428

markster at lists.digium.com markster at lists.digium.com
Sat Jun 26 17:31:19 CDT 2004


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

Modified Files:
	chan_sip.c 
Log Message:
Add option for in-band progress (bug #1879)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.427
retrieving revision 1.428
diff -u -d -r1.427 -r1.428
--- chan_sip.c	25 Jun 2004 18:23:06 -0000	1.427
+++ chan_sip.c	26 Jun 2004 21:17:12 -0000	1.428
@@ -158,6 +158,8 @@
 
 static int globaltrustrpid = 0;
 
+static int globalprogressinband = 0;
+
 #ifdef OSP_SUPPORT
 static int globalospauth = 0;
 #endif
@@ -340,10 +342,11 @@
 	int dialogver;
 	int promiscredir;			/* Promiscuous redirection */
 	
-        int trustrpid;
+	int trustrpid;
+	int progressinband;
 	
-        int dtmfmode;
-        struct ast_dsp *vad;
+	int dtmfmode;
+	struct ast_dsp *vad;
 	
 	struct sip_peer *peerpoke;		/* If this calls is to poke a peer, which one */
 	struct sip_registry *registry;		/* If this is a REGISTER call, to which registry */
@@ -400,6 +403,7 @@
 	int promiscredir;
 	int restrictcid;
 	int trustrpid;
+	int progressinband;
 	struct ast_ha *ha;
 #ifdef MYSQL_USERS
 	int temponly;
@@ -438,8 +442,9 @@
 	unsigned int callgroup;
 	unsigned int pickupgroup;
 	int promiscredir;
-        int dtmfmode;
-        int trustrpid;
+	int dtmfmode;
+	int trustrpid;
+	int progressinband;
 	struct sockaddr_in addr;
 	struct in_addr mask;
 
@@ -1872,7 +1877,8 @@
 			if (!p->progress) {
 				transmit_response(p, "180 Ringing", &p->initreq);
 				p->ringing = 1;
-				break;
+				if (!p->progressinband)
+					break;
 			} else {
 				/* Oops, we've sent progress tones.  Let Asterisk do it instead */
 			}
@@ -2251,6 +2257,7 @@
 	p->dtmfmode = globaldtmfmode;
 	p->promiscredir = globalpromiscredir;
 	p->trustrpid = globaltrustrpid;
+	p->progressinband = globalprogressinband;
 #ifdef OSP_SUPPORT
 	p->ospauth = globalospauth;
 #endif
@@ -5051,6 +5058,7 @@
 		p->ospauth = user->ospauth;
 #endif
 		p->trustrpid = user->trustrpid;
+		p->progressinband = user->progressinband;
 		/* replace callerid if rpid found, and not restricted */
 		if(!ast_strlen_zero(rpid_num) && p->trustrpid) {
 		  if (*calleridname)
@@ -5121,6 +5129,7 @@
 			/* Take the peer */
 			p->nat = peer->nat;
 			p->trustrpid = peer->trustrpid;
+			p->progressinband = peer->progressinband;
 			/* replace callerid if rpid found, and not restricted */
 			if(!ast_strlen_zero(rpid_num) && p->trustrpid) {
 			  if (*calleridname)
@@ -7564,6 +7573,7 @@
 
 		user->canreinvite = globalcanreinvite;
 		user->trustrpid = globaltrustrpid;
+		user->progressinband = globalprogressinband;
 #ifdef OSP_SUPPORT
 		user->ospauth = globalospauth;
 #endif
@@ -7647,6 +7657,8 @@
 				user->restrictcid = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "trustrpid")) {
 				user->trustrpid = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "progressinband")) {
+				user->progressinband = ast_true(v->value);
 #ifdef OSP_SUPPORT
 			} else if (!strcasecmp(v->name, "ospauth")) {
 				if (!strcasecmp(v->value, "exclusive")) {
@@ -7694,6 +7706,7 @@
 	peer->selfdestruct = 1;
 	peer->dynamic = 1;
 	peer->trustrpid = globaltrustrpid;
+	peer->progressinband = globalprogressinband;
 #ifdef OSP_SUPPORT
 	peer->ospauth = globalospauth;
 #endif
@@ -7758,6 +7771,7 @@
 		peer->dtmfmode = 0;
 		peer->promiscredir = globalpromiscredir;
 		peer->trustrpid = globaltrustrpid;
+		peer->progressinband = globalprogressinband;
 #ifdef OSP_SUPPORT
 		peer->ospauth = globalospauth;
 #endif
@@ -7887,7 +7901,9 @@
 					peer->maxms = 0;
 				}
 			} else if (!strcasecmp(v->name, "trustrpid")) {
-                                peer->trustrpid = ast_true(v->value);
+				peer->trustrpid = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "progressinband")) {
+				peer->progressinband = ast_true(v->value);
 #ifdef OSP_SUPPORT
 			} else if (!strcasecmp(v->name, "ospauth")) {
 				if (!strcasecmp(v->value, "exclusive")) {
@@ -8014,7 +8030,9 @@
 		} else if (!strcasecmp(v->name, "srvlookup")) {
 			srvlookup = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "trustrpid")) {
-		        globaltrustrpid = ast_true(v->value);
+			globaltrustrpid = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "progressinband")) {
+			globalprogressinband = ast_true(v->value);
 #ifdef OSP_SUPPORT
 		} else if (!strcasecmp(v->name, "ospauth")) {
 			if (!strcasecmp(v->value, "exclusive")) {




More information about the svn-commits mailing list