]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 45260 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 16 Oct 2006 19:37:34 +0000 (19:37 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 16 Oct 2006 19:37:34 +0000 (19:37 +0000)
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.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45262 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
configs/sip.conf.sample

index 286269751647779c87d0dcb0a260190b70ae22dd..0a486da5801d58dfa79a98db1f7daceacfcc464c 100644 (file)
@@ -541,6 +541,8 @@ static enum transfermodes global_allowtransfer;     /*!< SIP Refer restriction schem
 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 */
 static int ruserobjs = 0;                /*!< Realtime users */
@@ -4266,9 +4268,14 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
                }
        }
        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;
 }
 
@@ -10006,6 +10013,7 @@ static int sip_show_settings(int fd, int argc, char *argv[])
        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");
@@ -15025,6 +15033,11 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
        } 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;
@@ -15703,6 +15716,7 @@ static int reload_config(enum channelreloadreason reason)
        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));
index 07389e16bc3aeee3eb44331aaa8d6279d8419029..5ea8b4d361e3f698ff08f9dd9c2e066b5e48285a 100644 (file)
@@ -132,6 +132,8 @@ srvlookup=yes                       ; Enable DNS SRV lookups on outbound calls
                                ; 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
 ; NoOp priority 1 extension for a given peer who registers or unregisters with