Merge OSP udpates
authorMark Spencer <markster@digium.com>
Mon, 14 Feb 2005 19:46:45 +0000 (19:46 +0000)
committerMark Spencer <markster@digium.com>
Mon, 14 Feb 2005 19:46:45 +0000 (19:46 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5029 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 9f249a0..cfd9607 100755 (executable)
@@ -164,7 +164,7 @@ static int rpeerobjs = 0;
 static int apeerobjs = 0;
 static int regobjs = 0;
 
-static int global_allowguest = 0;    /* allow unauthenticated users/peers to connect? */
+static int global_allowguest = 1;    /* allow unauthenticated users/peers to connect? */
 
 #define DEFAULT_MWITIME 10
 static int global_mwitime = DEFAULT_MWITIME;   /* Time between MWI checks for peers */
@@ -5000,6 +5000,7 @@ static int check_auth(struct sip_pvt *p, struct sip_request *req, char *randdata
        if (ast_strlen_zero(secret) && ast_strlen_zero(md5secret)
 #ifdef OSP_SUPPORT
            && ast_test_flag(p, SIP_OSPAUTH)
+           && global_allowguest != 2
 #endif
                )
                return 0;
@@ -8978,6 +8979,16 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
                        ast_set_flag(flags, SIP_PROG_INBAND_NO);
                else if (ast_true(v->value))
                        ast_set_flag(flags, SIP_PROG_INBAND_YES);
+       } else if (!strcasecmp(v->name, "allowguest")) {
+#ifdef OSP_SUPPORT
+               if(!strcasecmp(v->value, "osp"))
+                       global_allowguest = 2;
+               else 
+#endif
+                       if (ast_true(v->value)) 
+                               global_allowguest = 1;
+                       else
+                               global_allowguest = 0;
 #ifdef OSP_SUPPORT
        } else if (!strcasecmp(v->name, "ospauth")) {
                ast_set_flag(mask, SIP_OSPAUTH);