From 90267ab0ead82aa339099e31bca947769eeb7250 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Mon, 14 Feb 2005 19:46:45 +0000 Subject: [PATCH] Merge OSP udpates git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5029 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9f249a0339..cfd96076c6 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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);