mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 15:08:53 +00:00
Formatting fixes, speling eror fiksd ;-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -6167,24 +6167,24 @@ static void build_route(struct sip_pvt *p, struct sip_request *req, int backward
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OSP_SUPPORT
|
#ifdef OSP_SUPPORT
|
||||||
/*! \brief check_osptoken: Validate OSP token for user authrroization */
|
/*! \brief Validate OSP token for user authorization */
|
||||||
static int check_osptoken (struct sip_pvt *p, char *token)
|
static int check_osptoken (struct sip_pvt *p, char *token)
|
||||||
{
|
{
|
||||||
char tmp[80];
|
char tmp[80];
|
||||||
|
|
||||||
if (ast_osp_validate (NULL, token, &p->osphandle, &p->osptimelimit, p->cid_num, p->sa.sin_addr, p->exten) < 1) {
|
if (ast_osp_validate (NULL, token, &p->osphandle, &p->osptimelimit, p->cid_num, p->sa.sin_addr, p->exten) < 1) {
|
||||||
return (-1);
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
snprintf (tmp, sizeof (tmp), "%d", p->osphandle);
|
snprintf (tmp, sizeof (tmp), "%d", p->osphandle);
|
||||||
pbx_builtin_setvar_helper (p->owner, "_OSPHANDLE", tmp);
|
pbx_builtin_setvar_helper (p->owner, "_OSPHANDLE", tmp);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*! \brief check_auth: Check user authorization from peer definition */
|
/*! \brief Check user authorization from peer definition
|
||||||
/* Some actions, like REGISTER and INVITEs from peers require
|
Some actions, like REGISTER and INVITEs from peers require
|
||||||
authentication (if peer have secret set) */
|
authentication (if peer have secret set) */
|
||||||
static int check_auth(struct sip_pvt *p, struct sip_request *req, const char *username,
|
static int check_auth(struct sip_pvt *p, struct sip_request *req, const char *username,
|
||||||
const char *secret, const char *md5secret, int sipmethod,
|
const char *secret, const char *md5secret, int sipmethod,
|
||||||
char *uri, int reliable, int ignore)
|
char *uri, int reliable, int ignore)
|
||||||
@@ -6223,31 +6223,31 @@ static int check_auth(struct sip_pvt *p, struct sip_request *req, const char *us
|
|||||||
case SIP_OSPAUTH_GATEWAY:
|
case SIP_OSPAUTH_GATEWAY:
|
||||||
if (ast_strlen_zero (osptoken)) {
|
if (ast_strlen_zero (osptoken)) {
|
||||||
if (ast_strlen_zero (secret) && ast_strlen_zero (md5secret)) {
|
if (ast_strlen_zero (secret) && ast_strlen_zero (md5secret)) {
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (check_osptoken (p, osptoken));
|
return check_osptoken (p, osptoken);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIP_OSPAUTH_PROXY:
|
case SIP_OSPAUTH_PROXY:
|
||||||
if (ast_strlen_zero (osptoken)) {
|
if (ast_strlen_zero (osptoken)) {
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (check_osptoken (p, osptoken));
|
return check_osptoken (p, osptoken);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIP_OSPAUTH_EXCLUSIVE:
|
case SIP_OSPAUTH_EXCLUSIVE:
|
||||||
if (ast_strlen_zero (osptoken)) {
|
if (ast_strlen_zero (osptoken)) {
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (check_osptoken (p, osptoken));
|
return check_osptoken (p, osptoken);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (-1);
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user