Index: asterisk/channels/chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.561
diff -u -3 -r1.561 chan_sip.c
--- asterisk/channels/chan_sip.c	12 Nov 2004 13:27:11 -0000	1.561
+++ asterisk/channels/chan_sip.c	13 Nov 2004 11:49:25 -0000
@@ -145,6 +145,8 @@
 
 static int global_progressinband = 0;
 
+static int global_ringingresponse = 0;
+
 #ifdef OSP_SUPPORT
 static int global_ospauth = 0;
 #endif
@@ -338,6 +340,7 @@
 	
 	int trustrpid;
 	int progressinband;
+	int ringingresponse;
 	
 	int dtmfmode;
 	struct ast_dsp *vad;
@@ -399,6 +402,7 @@
 	int useclientcode;
 	int trustrpid;
 	int progressinband;
+	int ringingresponse;
 	struct ast_ha *ha;
 	int temponly;
 	struct sip_user *next;
@@ -443,6 +447,7 @@
 	int trustrpid;
 	int useclientcode;
 	int progressinband;
+	int ringingresponse;
 	struct sockaddr_in addr;
 	struct in_addr mask;
 
@@ -1900,7 +1905,7 @@
 	switch(condition) {
 	case AST_CONTROL_RINGING:
 		if (ast->_state == AST_STATE_RING) {
-			if (!p->progress) {
+			if (!p->progress || p->ringingresponse) {
 				transmit_response(p, "180 Ringing", &p->initreq);
 				p->ringing = 1;
 				if (!p->progressinband)
@@ -2320,6 +2325,7 @@
 	p->promiscredir = global_promiscredir;
 	p->trustrpid = global_trustrpid;
 	p->progressinband = global_progressinband;
+	p->ringingresponse = global_ringingresponse;
 #ifdef OSP_SUPPORT
 	p->ospauth = global_ospauth;
 #endif
@@ -5301,6 +5307,7 @@
 		p->trustrpid = user->trustrpid;
 		p->useclientcode = user->useclientcode;
 		p->progressinband = user->progressinband;
+		p->ringingresponse = user->ringingresponse;
 		/* replace callerid if rpid found, and not restricted */
 		if(!ast_strlen_zero(rpid_num) && p->trustrpid) {
 		  if (*calleridname)
@@ -5380,6 +5387,7 @@
 			p->trustrpid = peer->trustrpid;
 			p->useclientcode = peer->useclientcode;
 			p->progressinband = peer->progressinband;
+			p->ringingresponse = peer->ringingresponse;
 			/* replace callerid if rpid found, and not restricted */
 			if(!ast_strlen_zero(rpid_num) && p->trustrpid) {
 			  if (*calleridname)
@@ -5788,6 +5796,8 @@
 		ast_cli(fd, "%s\n",status);
  		ast_cli(fd, "  Useragent    : %s\n", peer->useragent);
  		ast_cli(fd, "  Full Contact : %s\n", peer->fullcontact);
+ 		ast_cli(fd, "  Progress InBand : %s\n", (peer->progressinband?"Yes":"No"));
+ 		ast_cli(fd, "  Ringing response : %s\n", (peer->ringingresponse?"Yes":"No"));
 		ast_cli(fd,"\n");
 	} else {
 		ast_cli(fd,"Peer %s not found.\n", argv[3]);
@@ -8112,6 +8122,7 @@
 		user->trustrpid = global_trustrpid;
 		user->dtmfmode = global_dtmfmode;
 		user->progressinband = global_progressinband;
+		user->ringingresponse = global_ringingresponse;
 #ifdef OSP_SUPPORT
 		user->ospauth = global_ospauth;
 #endif
@@ -8205,6 +8216,8 @@
 				user->useclientcode = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "progressinband")) {
 				user->progressinband = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "ringingresponse")) {
+				user->ringingresponse = ast_true(v->value);
 #ifdef OSP_SUPPORT
 			} else if (!strcasecmp(v->name, "ospauth")) {
 				if (!strcasecmp(v->value, "exclusive")) {
@@ -8254,6 +8267,7 @@
 	peer->dynamic = 1;
 	peer->trustrpid = global_trustrpid;
 	peer->progressinband = global_progressinband;
+	peer->ringingresponse = global_ringingresponse;
 #ifdef OSP_SUPPORT
 	peer->ospauth = global_ospauth;
 #endif
@@ -8326,6 +8340,7 @@
 		peer->promiscredir = global_promiscredir;
 		peer->trustrpid = global_trustrpid;
 		peer->progressinband = global_progressinband;
+		peer->ringingresponse = global_ringingresponse;
 #ifdef OSP_SUPPORT
 		peer->ospauth = global_ospauth;
 #endif
@@ -8471,6 +8486,8 @@
 				peer->trustrpid = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "progressinband")) {
 				peer->progressinband = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "ringingresponse")) {
+				peer->ringingresponse = ast_true(v->value);
 #ifdef OSP_SUPPORT
 			} else if (!strcasecmp(v->name, "ospauth")) {
 				if (!strcasecmp(v->value, "exclusive")) {
@@ -8622,6 +8639,8 @@
 			global_trustrpid = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "progressinband")) {
 			global_progressinband = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "ringingresponse")) {
+			global_ringingresponse = ast_true(v->value);
 #ifdef OSP_SUPPORT
 		} else if (!strcasecmp(v->name, "ospauth")) {
 			if (!strcasecmp(v->value, "exclusive")) {
Index: asterisk/configs/sip.conf.sample
===================================================================
RCS file: /usr/cvsroot/asterisk/configs/sip.conf.sample,v
retrieving revision 1.42
diff -u -3 -r1.42 sip.conf.sample
--- asterisk/configs/sip.conf.sample	12 Nov 2004 03:57:39 -0000	1.42
+++ asterisk/configs/sip.conf.sample	13 Nov 2004 11:49:25 -0000
@@ -62,6 +62,7 @@
 				; when we're on hold (must be > rtptimeout)
 ;trustrpid = no			; If Remote-Party-ID should be trusted
 ;progressinband=no		; If we should generate in-band ringing always
+;ringingresponse=no
 ;useragent=Asterisk PBX		; Allows you to change the user agent string
 ;nat=no				; NAT settings 
                                 ; yes = Always ignore info and assume NAT
@@ -151,6 +152,7 @@
 ; insecure                    insecure
 ; trustrpid                   trustrpid
 ; progressinband              progressinband
+; ringingresponse             ringingresponse
 ; promiscredir                promiscredir
 ; useclientcode               useclientcode
 ; callerid
