[asterisk-commits] file: trunk r45263 - in /trunk: ./ channels/chan_sip.c configs/sip.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Oct 16 12:43:34 MST 2006


Author: file
Date: Mon Oct 16 14:43:33 2006
New Revision: 45263

URL: http://svn.digium.com/view/asterisk?rev=45263&view=rev
Log:
Merged revisions 45262 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r45262 | file | 2006-10-16 15:37:34 -0400 (Mon, 16 Oct 2006) | 10 lines

Merged revisions 45260 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45260 | file | 2006-10-16 15:28:18 -0400 (Mon, 16 Oct 2006) | 2 lines

Add 'ignoreoodreplies' option which will not create a pvt structure on a SIP response but instead basically drop it.

........

................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c
    trunk/configs/sip.conf.sample

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=45263&r1=45262&r2=45263&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Oct 16 14:43:33 2006
@@ -535,6 +535,8 @@
 /*! \brief Codecs that we support by default: */
 static int global_capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263;
 static int noncodeccapability = AST_RTP_DTMF;
+
+static int global_ignoreoodreplies = 1;
 
 /* Object counters */
 static int suserobjs = 0;                /*!< Static users */
@@ -4257,9 +4259,14 @@
 		}
 	}
 	ast_mutex_unlock(&iflock);
+
+	if (req->method == SIP_RESPONSE && global_ignoreoodreplies)
+		return NULL;
+
 	/* Allocate new call */
 	if ((p = sip_alloc(callid, sin, 1, intended_method)))
 		ast_mutex_lock(&p->lock);
+
 	return p;
 }
 
@@ -9985,6 +9992,7 @@
 	ast_cli(fd, "  Allow subscriptions:    %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_ALLOWSUBSCRIBE) ? "Yes" : "No");
 	ast_cli(fd, "  Allow overlap dialing:  %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_ALLOWOVERLAP) ? "Yes" : "No");
 	ast_cli(fd, "  Promsic. redir:         %s\n", ast_test_flag(&global_flags[0], SIP_PROMISCREDIR) ? "Yes" : "No");
+	ast_cli(fd, "  Drop misc replies:      %s\n", global_ignoreoodreplies ? "Yes" : "No");
 	ast_cli(fd, "  SIP domain support:     %s\n", AST_LIST_EMPTY(&domain_list) ? "No" : "Yes");
 	ast_cli(fd, "  Call to non-local dom.: %s\n", allow_external_domains ? "Yes" : "No");
 	ast_cli(fd, "  URI user is phone no:   %s\n", ast_test_flag(&global_flags[0], SIP_USEREQPHONE) ? "Yes" : "No");
@@ -14968,6 +14976,11 @@
 	} else if (!strcasecmp(v->name, "rfc2833compensate")) {
 		ast_set_flag(&mask[1], SIP_PAGE2_RFC2833_COMPENSATE);
 		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_RFC2833_COMPENSATE);
+	} else if (!strcasecmp(v->name, "ignoreoodreplies")) {
+		if (ast_true(v->value))
+			global_ignoreoodreplies = 1;
+		else
+			global_ignoreoodreplies = 0;
 	}
 
 	return res;
@@ -15657,6 +15670,7 @@
 	ast_set_flag(&global_flags[1], SIP_PAGE2_ALLOWSUBSCRIBE);	/* Default for peers, users: TRUE */
 	ast_set_flag(&global_flags[1], SIP_PAGE2_ALLOWOVERLAP);		/* Default for peers, users: TRUE */
 	ast_set_flag(&global_flags[1], SIP_PAGE2_RTUPDATE);
+	global_ignoreoodreplies = 1;
 
 	/* Initialize some reasonable defaults at SIP reload (used both for channel and as default for peers and users */
 	ast_copy_string(default_context, DEFAULT_CONTEXT, sizeof(default_context));

Modified: trunk/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/sip.conf.sample?rev=45263&r1=45262&r2=45263&view=diff
==============================================================================
--- trunk/configs/sip.conf.sample (original)
+++ trunk/configs/sip.conf.sample Mon Oct 16 14:43:33 2006
@@ -131,6 +131,8 @@
 				; for Sipura and Grandstream ATAs, among others). This is
 				; contrary to the RFC3551 specification, the peer _should_
 				; be negotiating AAL2-G726-32 instead :-(
+
+;ignoreoodreplies = no          ; If no then out of dialog replies will not be ignored
 
 ;
 ; If regcontext is specified, Asterisk will dynamically create and destroy a



More information about the asterisk-commits mailing list