[asterisk-commits] branch oej/peermatch r20293 - in
/team/oej/peermatch: ./ apps/ channels/ conf...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Apr 15 06:23:05 MST 2006
Author: oej
Date: Sat Apr 15 08:22:52 2006
New Revision: 20293
URL: http://svn.digium.com/view/asterisk?rev=20293&view=rev
Log:
Update to trunk
Modified:
team/oej/peermatch/ (props changed)
team/oej/peermatch/UPGRADE.txt
team/oej/peermatch/apps/app_dial.c
team/oej/peermatch/apps/app_osplookup.c
team/oej/peermatch/channels/chan_sip.c
team/oej/peermatch/configs/osp.conf.sample
team/oej/peermatch/doc/channelvariables.txt
team/oej/peermatch/formats/format_jpeg.c
team/oej/peermatch/include/asterisk/astosp.h
team/oej/peermatch/res/res_osp.c
Propchange: team/oej/peermatch/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/peermatch/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/peermatch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Apr 15 08:22:52 2006
@@ -1,1 +1,1 @@
-/trunk:1-18358
+/trunk:1-18482
Modified: team/oej/peermatch/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/UPGRADE.txt?rev=20293&r1=20292&r2=20293&view=diff
==============================================================================
--- team/oej/peermatch/UPGRADE.txt (original)
+++ team/oej/peermatch/UPGRADE.txt Sat Apr 15 08:22:52 2006
@@ -29,6 +29,8 @@
"noanswer" will not work. Use s or n. Also there is a new feature i, for
using indication tones, so typing in skip would give you unexpected results.
+* OSPAuth is added to authenticate OSP tokens in in_bound call setup messages.
+
Variables:
* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
@@ -39,6 +41,10 @@
* The CDR-CSV variables uniqueid, userfield, and basing time on GMT are now
adjustable from cdr.conf, instead of recompiling.
+
+* OSP applications exports several new variables, ${OSPINHANDLE},
+ ${OSPOUTHANDLE}, ${OSPINTOKEN}, ${OSPOUTTOKEN}, ${OSPCALLING},
+ ${OSPINTIMELIMIT}, and ${OSPOUTTIMELIMIT}
Functions:
@@ -66,6 +72,10 @@
* The "incominglimit" setting is replaced by the "call-limit" setting in sip.conf.
+* OSP support code is removed from SIP channel to OSP applications. ospauth
+ option in sip.conf is removed to osp.conf as authpolicy. allowguest option
+ in sip.conf cannot be set as osp anymore.
+
Installation:
* On BSD systems, the installation directories have changed to more "FreeBSDish" directories. On startup, Asterisk will look for the main configuration in /usr/local/etc/asterisk/asterisk.conf
Modified: team/oej/peermatch/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/apps/app_dial.c?rev=20293&r1=20292&r2=20293&view=diff
==============================================================================
--- team/oej/peermatch/apps/app_dial.c (original)
+++ team/oej/peermatch/apps/app_dial.c Sat Apr 15 08:22:52 2006
@@ -1189,10 +1189,6 @@
}
if (peer) {
time(&answer_time);
-#ifdef OSP_SUPPORT
- /* Once call is answered, ditch the OSP Handle */
- pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
-#endif
strcpy(status, "ANSWER");
/* Ah ha! Someone answered within the desired timeframe. Of course after this
we will always return with -1 so that it is hung up properly after the
Modified: team/oej/peermatch/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/apps/app_osplookup.c?rev=20293&r1=20292&r2=20293&view=diff
==============================================================================
--- team/oej/peermatch/apps/app_osplookup.c (original)
+++ team/oej/peermatch/apps/app_osplookup.c Sat Apr 15 08:22:52 2006
@@ -16,9 +16,9 @@
* at the top of the source tree.
*/
-/*! \file
- *
- * \brief Open Settlement Protocol Lookup
+/*!
+ * \file
+ * \brief Open Settlement Protocol Applications
*
* \author Mark Spencer <markster at digium.com>
*
@@ -49,44 +49,55 @@
#include "asterisk/app.h"
#include "asterisk/options.h"
-static char *tdesc = "OSP Lookup";
-
-static char *app = "OSPLookup";
-static char *app2 = "OSPNext";
-static char *app3 = "OSPFinish";
-
-static char *synopsis = "Lookup number in OSP";
-static char *synopsis2 = "Lookup next OSP entry";
-static char *synopsis3 = "Record OSP entry";
-
-static char *descrip =
+static char *app1= "OSPAuth";
+static char *synopsis1 = "OSP authentication";
+static char *descrip1 =
+" OSPAuth([provider[|options]]): Authenticate a SIP INVITE by OSP and sets\n"
+"the variables:\n"
+" ${OSPINHANDLE}: The in_bound call transaction handle\n"
+" ${OSPINTIMELIMIT}: The in_bound call duration limit in seconds\n"
+"\n"
+"The option string may contain the following character:\n"
+" 'j' -- jump to n+101 priority if the authentication was NOT successful\n"
+"This application sets the following channel variable upon completion:\n"
+" OSPAUTHSTATUS The status of the OSP Auth attempt as a text string, one of\n"
+" SUCCESS | FAILED | ERROR\n";
+
+static char *app2= "OSPLookup";
+static char *synopsis2 = "Lookup destination by OSP";
+static char *descrip2 =
" OSPLookup(exten[|provider[|options]]): Looks up an extension via OSP and sets\n"
"the variables, where 'n' is the number of the result beginning with 1:\n"
-" ${OSPTECH}: The technology to use for the call\n"
-" ${OSPDEST}: The destination to use for the call\n"
-" ${OSPTOKEN}: The actual OSP token as a string\n"
-" ${OSPHANDLE}: The OSP Handle for anything remaining\n"
-" ${OSPRESULTS}: The number of OSP results total remaining\n"
+" ${OSPOUTHANDLE}: The OSP Handle for anything remaining\n"
+" ${OSPTECH}: The technology to use for the call\n"
+" ${OSPDEST}: The destination to use for the call\n"
+" ${OSPCALLING}: The calling number to use for the call\n"
+" ${OSPOUTTOKEN}: The actual OSP token as a string\n"
+" ${OSPOUTTIMELIMIT}: The out_bound call duration limit in seconds\n"
+" ${OSPRESULTS}: The number of OSP results total remaining\n"
"\n"
"The option string may contain the following character:\n"
" 'j' -- jump to n+101 priority if the lookup was NOT successful\n"
"This application sets the following channel variable upon completion:\n"
" OSPLOOKUPSTATUS The status of the OSP Lookup attempt as a text string, one of\n"
-" SUCCESS | FAILED \n";
-
-
-static char *descrip2 =
-" OSPNext(cause[|options]): Looks up the next OSP Destination for ${OSPHANDLE}\n"
+" SUCCESS | FAILED | ERROR\n";
+
+static char *app3 = "OSPNext";
+static char *synopsis3 = "Lookup next destination by OSP";
+static char *descrip3 =
+" OSPNext(cause[|options]): Looks up the next OSP Destination for ${OSPOUTHANDLE}\n"
"See OSPLookup for more information\n"
"\n"
"The option string may contain the following character:\n"
" 'j' -- jump to n+101 priority if the lookup was NOT successful\n"
"This application sets the following channel variable upon completion:\n"
" OSPNEXTSTATUS The status of the OSP Next attempt as a text string, one of\n"
-" SUCCESS | FAILED \n";
-
-static char *descrip3 =
-" OSPFinish(status[|options]): Records call state for ${OSPHANDLE}, according to\n"
+" SUCCESS | FAILED |ERROR\n";
+
+static char *app4 = "OSPFinish";
+static char *synopsis4 = "Record OSP entry";
+static char *descrip4 =
+" OSPFinish([status[|options]]): Records call state for ${OSPINHANDLE}, according to\n"
"status, which should be one of BUSY, CONGESTION, ANSWER, NOANSWER, or CHANUNAVAIL\n"
"or coincidentally, just what the Dial application stores in its ${DIALSTATUS}.\n"
"\n"
@@ -94,278 +105,546 @@
" 'j' -- jump to n+101 priority if the finish attempt was NOT successful\n"
"This application sets the following channel variable upon completion:\n"
" OSPFINISHSTATUS The status of the OSP Finish attempt as a text string, one of\n"
-" SUCCESS | FAILED \n";
+" SUCCESS | FAILED |ERROR \n";
LOCAL_USER_DECL;
-static int str2cause(char *cause)
-{
- if (!strcasecmp(cause, "BUSY"))
- return AST_CAUSE_BUSY;
- if (!strcasecmp(cause, "CONGESTION"))
- return AST_CAUSE_CONGESTION;
- if (!strcasecmp(cause, "ANSWER"))
- return AST_CAUSE_NORMAL;
- if (!strcasecmp(cause, "CANCEL"))
- return AST_CAUSE_NORMAL;
- if (!strcasecmp(cause, "NOANSWER"))
- return AST_CAUSE_NOANSWER;
- if (!strcasecmp(cause, "NOCHANAVAIL"))
- return AST_CAUSE_CONGESTION;
- ast_log(LOG_WARNING, "Unknown cause '%s', using NORMAL\n", cause);
- return AST_CAUSE_NORMAL;
+static int ospauth_exec(struct ast_channel *chan, void *data)
+{
+ int res = 0;
+ struct localuser* u;
+ char* provider = OSP_DEF_PROVIDER;
+ int priority_jump = 0;
+ struct varshead* headp;
+ struct ast_var_t* current;
+ const char* source = "";
+ const char* token = "";
+ int handle;
+ unsigned int timelimit;
+ char* tmp;
+ char buffer[OSP_INTSTR_SIZE];
+ char* status;
+
+ AST_DECLARE_APP_ARGS(args,
+ AST_APP_ARG(provider);
+ AST_APP_ARG(options);
+ );
+
+ LOCAL_USER_ADD(u);
+
+ if (!(tmp = ast_strdupa(data))) {
+ ast_log(LOG_ERROR, "Out of memory\n");
+ LOCAL_USER_REMOVE(u);
+ return(-1);
+ }
+
+ AST_STANDARD_APP_ARGS(args, tmp);
+
+ if (!ast_strlen_zero(args.provider)) {
+ provider = args.provider;
+ }
+ ast_log(LOG_DEBUG, "OSPAuth: provider '%s'\n", provider);
+
+ if (args.options) {
+ if (strchr(args.options, 'j')) {
+ priority_jump = 1;
+ }
+ }
+ ast_log(LOG_DEBUG, "OSPAuth: priority jump '%d'\n", priority_jump);
+
+ headp = &chan->varshead;
+ AST_LIST_TRAVERSE(headp, current, entries) {
+ if (!strcasecmp(ast_var_name(current), "OSPPEERIP")) {
+ source = ast_var_value(current);
+ } else if (!strcasecmp(ast_var_name(current), "OSPINTOKEN")) {
+ token = ast_var_value(current);
+ }
+ }
+ ast_log(LOG_DEBUG, "OSPAuth: source '%s'\n", source);
+ ast_log(LOG_DEBUG, "OSPAuth: token size '%d'\n", strlen(token));
+
+ res = ast_osp_auth(provider, &handle, source, chan->cid.cid_num, chan->exten, token, &timelimit);
+ if (res > 0) {
+ status = OSP_APP_SUCCESS;
+ } else {
+ timelimit = OSP_DEF_TIMELIMIT;
+ if (!res) {
+ status = OSP_APP_FAILED;
+ } else {
+ handle = OSP_INVALID_HANDLE;
+ status = OSP_APP_ERROR;
+ }
+ }
+
+ snprintf(buffer, sizeof(buffer), "%d", handle);
+ pbx_builtin_setvar_helper(chan, "OSPINHANDLE", buffer);
+ ast_log(LOG_DEBUG, "OSPAuth: OSPINHANDLE '%s'\n", buffer);
+ snprintf(buffer, sizeof(buffer), "%d", timelimit);
+ pbx_builtin_setvar_helper(chan, "OSPINTIMELIMIT", buffer);
+ ast_log(LOG_DEBUG, "OSPAuth: OSPINTIMELIMIT '%s'\n", buffer);
+ pbx_builtin_setvar_helper(chan, "OSPAUTHSTATUS", status);
+ ast_log(LOG_DEBUG, "OSPAuth: %s\n", status);
+
+ if(!res) {
+ if (priority_jump || ast_opt_priority_jumping) {
+ ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
+ } else {
+ res = -1;
+ }
+ } else if (res > 0) {
+ res = 0;
+ }
+
+ LOCAL_USER_REMOVE(u);
+
+ return(res);
}
static int osplookup_exec(struct ast_channel *chan, void *data)
{
- int res=0;
- struct localuser *u;
- char *temp;
+ int res = 0;
+ struct localuser* u;
+ char* provider = OSP_DEF_PROVIDER;
+ int priority_jump = 0;
+ struct varshead* headp;
+ struct ast_var_t* current;
+ const char* srcdev = "";
+ char* tmp;
+ char buffer[OSP_TOKSTR_SIZE];
struct ast_osp_result result;
- int priority_jump = 0;
+ char* status;
+
AST_DECLARE_APP_ARGS(args,
- AST_APP_ARG(extension);
+ AST_APP_ARG(exten);
AST_APP_ARG(provider);
AST_APP_ARG(options);
);
if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "OSPLookup requires an argument OSPLookup(exten[|provider[|options]])\n");
- return -1;
+ ast_log(LOG_WARNING, "OSPLookup: Arg required, OSPLookup(exten[|provider[|options]])\n");
+ return(-1);
}
LOCAL_USER_ADD(u);
- if (!(temp = ast_strdupa(data))) {
+ if (!(tmp = ast_strdupa(data))) {
+ ast_log(LOG_ERROR, "Out of memory\n");
LOCAL_USER_REMOVE(u);
- return -1;
- }
-
- AST_STANDARD_APP_ARGS(args, temp);
+ return(-1);
+ }
+
+ AST_STANDARD_APP_ARGS(args, tmp);
+
+ ast_log(LOG_DEBUG, "OSPLookup: exten '%s'\n", args.exten);
+
+ if (!ast_strlen_zero(args.provider)) {
+ provider = args.provider;
+ }
+ ast_log(LOG_DEBUG, "OSPlookup: provider '%s'\n", provider);
if (args.options) {
- if (strchr(args.options, 'j'))
+ if (strchr(args.options, 'j')) {
priority_jump = 1;
- }
-
- ast_log(LOG_DEBUG, "Whoo hoo, looking up OSP on '%s' via '%s'\n", args.extension, args.provider ? args.provider : "<default>");
- if ((res = ast_osp_lookup(chan, args.provider, args.extension, chan->cid.cid_num, &result)) > 0) {
- char tmp[80];
- snprintf(tmp, sizeof(tmp), "%d", result.handle);
- pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
- pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
- pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
- pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
- snprintf(tmp, sizeof(tmp), "%d", result.numresults);
- pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
- pbx_builtin_setvar_helper(chan, "OSPLOOKUPSTATUS", "SUCCESS");
-
+ }
+ }
+ ast_log(LOG_DEBUG, "OSPLookup: priority jump '%d'\n", priority_jump);
+
+ result.inhandle = OSP_INVALID_HANDLE;
+
+ headp = &chan->varshead;
+ AST_LIST_TRAVERSE(headp, current, entries) {
+ if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) {
+ if (sscanf(ast_var_value(current), "%d", &result.inhandle) != 1) {
+ result.inhandle = OSP_INVALID_HANDLE;
+ }
+ } else if (!strcasecmp(ast_var_name(current), "OSPINTIMELIMIT")) {
+ if (sscanf(ast_var_value(current), "%d", &result.intimelimit) != 1) {
+ result.intimelimit = OSP_DEF_TIMELIMIT;
+ }
+ } else if (!strcasecmp(ast_var_name(current), "OSPPEERIP")) {
+ srcdev = ast_var_value(current);
+ }
+ }
+ ast_log(LOG_DEBUG, "OSPLookup: OSPINHANDLE '%d'\n", result.inhandle);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPINTIMELIMIT '%d'\n", result.intimelimit);
+ ast_log(LOG_DEBUG, "OSPLookup: source device '%s'\n", srcdev);
+
+ res = ast_osp_lookup(provider, srcdev, chan->cid.cid_num, args.exten, &result);
+ if (res > 0) {
+ status = OSP_APP_SUCCESS;
} else {
+ result.tech[0] = '\0';
+ result.dest[0] = '\0';
+ result.calling[0] = '\0';
+ result.token[0] = '\0';
+ result.numresults = 0;
+ result.outtimelimit = OSP_DEF_TIMELIMIT;
if (!res) {
- ast_log(LOG_NOTICE, "OSP Lookup failed for '%s' (provider '%s')\n", args.extension, args.provider ? args.provider : "<default>");
- pbx_builtin_setvar_helper(chan, "OSPLOOKUPSTATUS", "FAILED");
- } else
- ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Lookup for '%s' (provider '%s')!\n", chan->name, args.extension, args.provider ? args.provider : "<default>" );
- }
- if (!res) {
- /* Look for a "busy" place */
- if (priority_jump || ast_opt_priority_jumping)
+ status = OSP_APP_FAILED;
+ } else {
+ result.outhandle = OSP_INVALID_HANDLE;
+ status = OSP_APP_ERROR;
+ }
+ }
+
+ snprintf(buffer, sizeof(buffer), "%d", result.outhandle);
+ pbx_builtin_setvar_helper(chan, "OSPOUTHANDLE", buffer);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPOUTHANDLE '%s'\n", buffer);
+ pbx_builtin_setvar_helper(chan, "OSPTECH", result.tech);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPTECH '%s'\n", result.tech);
+ pbx_builtin_setvar_helper(chan, "OSPDEST", result.dest);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPDEST '%s'\n", result.dest);
+ pbx_builtin_setvar_helper(chan, "OSPCALLING", result.calling);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPCALLING '%s'\n", result.calling);
+ pbx_builtin_setvar_helper(chan, "OSPOUTTOKEN", result.token);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPOUTTOKEN size '%d'\n", strlen(result.token));
+ if (!ast_strlen_zero(result.token)) {
+ snprintf(buffer, sizeof(buffer), "P-OSP-Auth-Token: %s", result.token);
+ pbx_builtin_setvar_helper(chan, "_SIPADDHEADER", buffer);
+ ast_log(LOG_DEBUG, "OSPLookup: SIPADDHEADER size '%d'\n", strlen(buffer));
+ }
+ snprintf(buffer, sizeof(buffer), "%d", result.numresults);
+ pbx_builtin_setvar_helper(chan, "OSPRESULTS", buffer);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPRESULTS '%s'\n", buffer);
+ snprintf(buffer, sizeof(buffer), "%d", result.outtimelimit);
+ pbx_builtin_setvar_helper(chan, "OSPOUTTIMELIMIT", buffer);
+ ast_log(LOG_DEBUG, "OSPLookup: OSPOUTTIMELIMIT '%s'\n", buffer);
+ pbx_builtin_setvar_helper(chan, "OSPLOOKUPSTATUS", status);
+ ast_log(LOG_DEBUG, "OSPLookup: %s\n", status);
+
+ if(!res) {
+ if (priority_jump || ast_opt_priority_jumping) {
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
- } else if (res > 0)
+ } else {
+ res = -1;
+ }
+ } else if (res > 0) {
res = 0;
+ }
+
LOCAL_USER_REMOVE(u);
- return res;
+
+ return(res);
+}
+
+static int str2cause(char *str)
+{
+ int cause = AST_CAUSE_NORMAL;
+
+ if (ast_strlen_zero(str)) {
+ cause = AST_CAUSE_NOTDEFINED;
+ } else if (!strcasecmp(str, "BUSY")) {
+ cause = AST_CAUSE_BUSY;
+ } else if (!strcasecmp(str, "CONGESTION")) {
+ cause = AST_CAUSE_CONGESTION;
+ } else if (!strcasecmp(str, "ANSWER")) {
+ cause = AST_CAUSE_NORMAL;
+ } else if (!strcasecmp(str, "CANCEL")) {
+ cause = AST_CAUSE_NORMAL;
+ } else if (!strcasecmp(str, "NOANSWER")) {
+ cause = AST_CAUSE_NOANSWER;
+ } else if (!strcasecmp(str, "NOCHANAVAIL")) {
+ cause = AST_CAUSE_CONGESTION;
+ } else {
+ ast_log(LOG_WARNING, "OSP: Unknown cause '%s', using NORMAL\n", str);
+ }
+
+ return(cause);
}
static int ospnext_exec(struct ast_channel *chan, void *data)
{
int res=0;
struct localuser *u;
- char *temp;
- const char *val;
+ int priority_jump = 0;
int cause;
+ struct varshead* headp;
+ struct ast_var_t* current;
struct ast_osp_result result;
- int priority_jump = 0;
+ char *tmp;
+ char buffer[OSP_TOKSTR_SIZE];
+ char* status;
+
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(cause);
AST_APP_ARG(options);
);
if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "OSPNext should have an argument (cause[|options])\n");
- return -1;
+ ast_log(LOG_WARNING, "OSPNext: Arg required, OSPNext(cause[|options])\n");
+ return(-1);
}
LOCAL_USER_ADD(u);
- if (!(temp = ast_strdupa(data))) {
+ if (!(tmp = ast_strdupa(data))) {
+ ast_log(LOG_ERROR, "Out of memory\n");
LOCAL_USER_REMOVE(u);
- return -1;
- }
-
- AST_STANDARD_APP_ARGS(args, temp);
+ return(-1);
+ }
+
+ AST_STANDARD_APP_ARGS(args, tmp);
+
+ cause = str2cause(args.cause);
+ ast_log(LOG_DEBUG, "OSPNext: cause '%d'\n", cause);
if (args.options) {
if (strchr(args.options, 'j'))
priority_jump = 1;
}
-
- cause = str2cause(args.cause);
- val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
- result.handle = -1;
- if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
- val = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
- if (ast_strlen_zero(val) || (sscanf(val, "%d", &result.numresults) != 1)) {
- result.numresults = 0;
- }
- if ((res = ast_osp_next(&result, cause)) > 0) {
- char tmp[80];
- snprintf(tmp, sizeof(tmp), "%d", result.handle);
- pbx_builtin_setvar_helper(chan, "_OSPHANDLE", tmp);
- pbx_builtin_setvar_helper(chan, "_OSPTECH", result.tech);
- pbx_builtin_setvar_helper(chan, "_OSPDEST", result.dest);
- pbx_builtin_setvar_helper(chan, "_OSPTOKEN", result.token);
- snprintf(tmp, sizeof(tmp), "%d", result.numresults);
- pbx_builtin_setvar_helper(chan, "_OSPRESULTS", tmp);
- pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "SUCCESS");
- }
+ ast_log(LOG_DEBUG, "OSPNext: priority jump '%d'\n", priority_jump);
+
+ result.inhandle = OSP_INVALID_HANDLE;
+ result.outhandle = OSP_INVALID_HANDLE;
+ result.numresults = 0;
+
+ headp = &chan->varshead;
+ AST_LIST_TRAVERSE(headp, current, entries) {
+ if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) {
+ if (sscanf(ast_var_value(current), "%d", &result.inhandle) != 1) {
+ result.inhandle = OSP_INVALID_HANDLE;
+ }
+ } else if (!strcasecmp(ast_var_name(current), "OSPOUTHANDLE")) {
+ if (sscanf(ast_var_value(current), "%d", &result.outhandle) != 1) {
+ result.outhandle = OSP_INVALID_HANDLE;
+ }
+ } else if (!strcasecmp(ast_var_name(current), "OSPINTIMEOUT")) {
+ if (sscanf(ast_var_value(current), "%d", &result.intimelimit) != 1) {
+ result.intimelimit = OSP_DEF_TIMELIMIT;
+ }
+ } else if (!strcasecmp(ast_var_name(current), "OSPRESULTS")) {
+ if (sscanf(ast_var_value(current), "%d", &result.numresults) != 1) {
+ result.numresults = 0;
+ }
+ }
+ }
+ ast_log(LOG_DEBUG, "OSPNext: OSPINHANDLE '%d'\n", result.inhandle);
+ ast_log(LOG_DEBUG, "OSPNext: OSPOUTHANDLE '%d'\n", result.outhandle);
+ ast_log(LOG_DEBUG, "OSPNext: OSPINTIMELIMIT '%d'\n", result.intimelimit);
+ ast_log(LOG_DEBUG, "OSPNext: OSPRESULTS '%d'\n", result.numresults);
+
+ if ((res = ast_osp_next(cause, &result)) > 0) {
+ status = OSP_APP_SUCCESS;
} else {
+ result.tech[0] = '\0';
+ result.dest[0] = '\0';
+ result.calling[0] = '\0';
+ result.token[0] = '\0';
+ result.numresults = 0;
+ result.outtimelimit = OSP_DEF_TIMELIMIT;
if (!res) {
- if (result.handle < 0)
- ast_log(LOG_NOTICE, "OSP Lookup Next failed for handle '%d'\n", result.handle);
- else
- ast_log(LOG_DEBUG, "No OSP handle specified\n");
- pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", "FAILED");
- } else
- ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Next!\n", chan->name);
- }
- if (!res) {
- /* Look for a "busy" place */
- if (priority_jump || ast_opt_priority_jumping)
+ status = OSP_APP_FAILED;
+ } else {
+ result.outhandle = OSP_INVALID_HANDLE;
+ status = OSP_APP_ERROR;
+ }
+ }
+
+ pbx_builtin_setvar_helper(chan, "OSPTECH", result.tech);
+ ast_log(LOG_DEBUG, "OSPNext: OSPTECH '%s'\n", result.tech);
+ pbx_builtin_setvar_helper(chan, "OSPDEST", result.dest);
+ ast_log(LOG_DEBUG, "OSPNext: OSPDEST '%s'\n", result.dest);
+ pbx_builtin_setvar_helper(chan, "OSPCALLING", result.calling);
+ ast_log(LOG_DEBUG, "OSPNext: OSPCALLING '%s'\n", result.calling);
+ pbx_builtin_setvar_helper(chan, "OSPOUTTOKEN", result.token);
+ ast_log(LOG_DEBUG, "OSPNext: OSPOUTTOKEN size '%d'\n", strlen(result.token));
+ if (!ast_strlen_zero(result.token)) {
+ snprintf(buffer, sizeof(buffer), "P-OSP-Auth-Token: %s", result.token);
+ pbx_builtin_setvar_helper(chan, "_SIPADDHEADER", buffer);
+ ast_log(LOG_DEBUG, "OSPNext: SIPADDHEADER size '%d'\n", strlen(buffer));
+ }
+ snprintf(buffer, sizeof(buffer), "%d", result.numresults);
+ pbx_builtin_setvar_helper(chan, "OSPRESULTS", buffer);
+ ast_log(LOG_DEBUG, "OSPNext: OSPRESULTS '%s'\n", buffer);
+ snprintf(buffer, sizeof(buffer), "%d", result.outtimelimit);
+ pbx_builtin_setvar_helper(chan, "OSPOUTTIMELIMIT", buffer);
+ ast_log(LOG_DEBUG, "OSPNext: OSPOUTTIMELIMIT '%s'\n", buffer);
+ pbx_builtin_setvar_helper(chan, "OSPNEXTSTATUS", status);
+ ast_log(LOG_DEBUG, "OSPNext: %s\n", status);
+
+ if(!res) {
+ if (priority_jump || ast_opt_priority_jumping) {
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
- } else if (res > 0)
+ } else {
+ res = -1;
+ }
+ } else if (res > 0) {
res = 0;
+ }
+
LOCAL_USER_REMOVE(u);
- return res;
+
+ return(res);
}
static int ospfinished_exec(struct ast_channel *chan, void *data)
{
- int res=0;
- struct localuser *u;
- char *temp;
- const char *val;
+ int res = 1;
+ struct localuser* u;
+ int priority_jump = 0;
int cause;
- time_t start=0, duration=0;
- struct ast_osp_result result;
- int priority_jump = 0;
+ struct varshead* headp;
+ struct ast_var_t* current;
+ int inhandle = OSP_INVALID_HANDLE;
+ int outhandle = OSP_INVALID_HANDLE;
+ int recorded = 0;
+ time_t start, connect, end;
+ char* tmp;
+ char* str = "";
+ char buffer[OSP_INTSTR_SIZE];
+ char* status;
+
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(status);
AST_APP_ARG(options);
);
- if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "OSPFinish should have an argument (status[|options])\n");
- return -1;
- }
-
LOCAL_USER_ADD(u);
- if (!(temp = ast_strdupa(data))) {
+ if (!(tmp = ast_strdupa(data))) {
+ ast_log(LOG_ERROR, "Out of memory\n");
LOCAL_USER_REMOVE(u);
- return -1;
- }
-
- AST_STANDARD_APP_ARGS(args, temp);
+ return(-1);
+ }
+
+ AST_STANDARD_APP_ARGS(args, tmp);
if (args.options) {
if (strchr(args.options, 'j'))
priority_jump = 1;
}
+ ast_log(LOG_DEBUG, "OSPFinish: priority jump '%d'\n", priority_jump);
+
+ headp = &chan->varshead;
+ AST_LIST_TRAVERSE(headp, current, entries) {
+ if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) {
+ if (sscanf(ast_var_value(current), "%d", &inhandle) != 1) {
+ inhandle = OSP_INVALID_HANDLE;
+ }
+ } else if (!strcasecmp(ast_var_name(current), "OSPOUTHANDLE")) {
+ if (sscanf(ast_var_value(current), "%d", &outhandle) != 1) {
+ outhandle = OSP_INVALID_HANDLE;
+ }
+ } else if (!recorded &&
+ (!strcasecmp(ast_var_name(current), "OSPAUTHSTATUS") ||
+ !strcasecmp(ast_var_name(current), "OSPLOOKUPSTATUS") ||
+ !strcasecmp(ast_var_name(current), "OSPNEXTSTATUS")))
+ {
+ if (strcasecmp(ast_var_value(current), OSP_APP_SUCCESS)) {
+ recorded = 1;
+ }
+ }
+ }
+ ast_log(LOG_DEBUG, "OSPFinish: OSPINHANDLE '%d'\n", inhandle);
+ ast_log(LOG_DEBUG, "OSPFinish: OSPOUTHANDLE '%d'\n", outhandle);
+ ast_log(LOG_DEBUG, "OSPFinish: recorded '%d'\n", recorded);
+
+ if (!recorded) {
+ str = args.status;
+ }
+ cause = str2cause(str);
+ ast_log(LOG_DEBUG, "OSPFinish: cause '%d'\n", cause);
if (chan->cdr) {
- start = chan->cdr->answer.tv_sec;
- if (start)
- duration = time(NULL) - start;
- else
- duration = 0;
- } else
- ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
-
- cause = str2cause(args.status);
- val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
- result.handle = -1;
- if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
- if (!ast_osp_terminate(result.handle, cause, start, duration)) {
- pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
- pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "SUCCESS");
- res = 1;
+ start = chan->cdr->start.tv_sec;
+ connect = chan->cdr->answer.tv_sec;
+ if (connect) {
+ end = time(NULL);
+ } else {
+ end = connect;
}
} else {
- if (!res) {
- if (result.handle > -1)
- ast_log(LOG_NOTICE, "OSP Finish failed for handle '%d'\n", result.handle);
- else
- ast_log(LOG_DEBUG, "No OSP handle specified\n");
- pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "FAILED");
- } else
- ast_log(LOG_DEBUG, "Got hangup on '%s' while doing OSP Terminate!\n", chan->name);
- }
- if (!res) {
- /* Look for a "busy" place */
- if (priority_jump || ast_opt_priority_jumping)
+ start = 0;
+ connect = 0;
+ end = 0;
+ }
+ ast_log(LOG_DEBUG, "OSPFinish: start '%ld'\n", start);
+ ast_log(LOG_DEBUG, "OSPFinish: connect '%ld'\n", connect);
+ ast_log(LOG_DEBUG, "OSPFinish: end '%ld'\n", end);
+
+ if (ast_osp_finish(outhandle, cause, start, connect, end) <= 0) {
+ ast_log(LOG_DEBUG, "OSPFinish: Unable to report usage for out_bound call\n");
+ }
+ if (ast_osp_finish(inhandle, cause, start, connect, end) <= 0) {
+ ast_log(LOG_DEBUG, "OSPFinish: Unable to report usage for in_bound call\n");
+ }
+ snprintf(buffer, sizeof(buffer), "%d", OSP_INVALID_HANDLE);
+ pbx_builtin_setvar_helper(chan, "OSPOUTHANDLE", buffer);
+ pbx_builtin_setvar_helper(chan, "OSPINHANDLE", buffer);
+
+ if (res > 0) {
+ status = OSP_APP_SUCCESS;
+ } else if (!res) {
+ status = OSP_APP_FAILED;
+ } else {
+ status = OSP_APP_ERROR;
+ }
+ pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", status);
+
+ if(!res) {
+ if (priority_jump || ast_opt_priority_jumping) {
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);
- } else if (res > 0)
+ } else {
+ res = -1;
+ }
+ } else if (res > 0) {
res = 0;
+ }
+
LOCAL_USER_REMOVE(u);
- return res;
-}
-
-
-int unload_module(void)
+
+ return(res);
+}
+
+int load_module(void)
{
int res;
- res = ast_unregister_application(app3);
- res |= ast_unregister_application(app2);
- res |= ast_unregister_application(app);
-
- STANDARD_HANGUP_LOCALUSERS;
-
- return res;
-}
-
-int load_module(void)
+ ast_osp_adduse();
+
+ res = ast_register_application(app1, ospauth_exec, synopsis1, descrip1);
+ res |= ast_register_application(app2, osplookup_exec, synopsis2, descrip2);
+ res |= ast_register_application(app3, ospnext_exec, synopsis3, descrip3);
+ res |= ast_register_application(app4, ospfinished_exec, synopsis4, descrip4);
+
+ return(res);
+}
+
+int unload_module(void)
{
int res;
- res = ast_register_application(app, osplookup_exec, synopsis, descrip);
- res |= ast_register_application(app2, ospnext_exec, synopsis2, descrip2);
- res |= ast_register_application(app3, ospfinished_exec, synopsis3, descrip3);
-
- return res;
+ res = ast_unregister_application(app4);
+ res |= ast_unregister_application(app3);
+ res |= ast_unregister_application(app2);
+ res |= ast_unregister_application(app1);
+
+ STANDARD_HANGUP_LOCALUSERS;
+
+ ast_osp_deluse();
+
+ return(res);
}
int reload(void)
{
- return 0;
-}
-
+ return(0);
+}
char *description(void)
{
- return tdesc;
+ return("Open Settlement Protocol Applications");
}
int usecount(void)
{
int res;
STANDARD_USECOUNT(res);
- return res;
+ return(res);
}
char *key()
{
- return ASTERISK_GPL_KEY;
-}
-
+ return(ASTERISK_GPL_KEY);
+}
+
Modified: team/oej/peermatch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/peermatch/channels/chan_sip.c?rev=20293&r1=20292&r2=20293&view=diff
==============================================================================
--- team/oej/peermatch/channels/chan_sip.c (original)
+++ team/oej/peermatch/channels/chan_sip.c Sat Apr 15 08:22:52 2006
@@ -92,10 +92,6 @@
#include "asterisk/linkedlists.h"
#include "asterisk/stringfields.h"
#include "asterisk/monitor.h"
-
-#ifdef OSP_SUPPORT
-#include "asterisk/astosp.h"
-#endif
#ifndef FALSE
#define FALSE 0
@@ -511,7 +507,6 @@
/*! \brief Parameters to the transmit_invite function */
struct sip_invite_param {
const char *distinctive_ring; /*!< Distinctive ring header */
- const char *osptoken; /*!< OSP token for this call */
int addsipheaders; /*!< Add extra SIP headers */
const char *uri_options; /*!< URI options to add to the URI */
const char *vxml_url; /*!< VXML url for Cisco phones */
@@ -601,20 +596,14 @@
#define SIP_PROG_INBAND_NEVER (0 << 24)
#define SIP_PROG_INBAND_NO (1 << 24)
#define SIP_PROG_INBAND_YES (2 << 24)
-/* Open Settlement Protocol authentication */
-#define SIP_OSPAUTH (3 << 26) /*!< four settings, uses two bits */
-#define SIP_OSPAUTH_NO (0 << 26)
-#define SIP_OSPAUTH_GATEWAY (1 << 26)
-#define SIP_OSPAUTH_PROXY (2 << 26)
-#define SIP_OSPAUTH_EXCLUSIVE (3 << 26)
-#define SIP_CALL_ONHOLD (1 << 28) /*!< Call states */
-#define SIP_CALL_LIMIT (1 << 29) /*!< Call limit enforced for this call */
-#define SIP_SENDRPID (1 << 30) /*!< Remote Party-ID Support */
-#define SIP_INC_COUNT (1 << 31) /*!< Did this connection increment the counter of in-use calls? */
+#define SIP_CALL_ONHOLD (1 << 26) /*!< Call states */
+#define SIP_CALL_LIMIT (1 << 27) /*!< Call limit enforced for this call */
+#define SIP_SENDRPID (1 << 28) /*!< Remote Party-ID Support */
+#define SIP_INC_COUNT (1 << 29) /*!< Did this connection increment the counter of in-use calls? */
#define SIP_FLAGS_TO_COPY \
(SIP_PROMISCREDIR | SIP_TRUSTRPID | SIP_SENDRPID | SIP_DTMF | SIP_REINVITE | \
- SIP_PROG_INBAND | SIP_OSPAUTH | SIP_USECLIENTCODE | SIP_NAT | \
+ SIP_PROG_INBAND | SIP_USECLIENTCODE | SIP_NAT | \
SIP_USEREQPHONE | SIP_INSECURE_PORT | SIP_INSECURE_INVITE)
/* a new page of flags for peers */
@@ -726,11 +715,6 @@
char lastmsg[256]; /*!< Last Message sent/received */
int amaflags; /*!< AMA Flags */
int pendinginvite; /*!< Any pending invite */
-#ifdef OSP_SUPPORT
- int osphandle; /*!< OSP Handle for call */
- time_t ospstart; /*!< OSP Start time */
- unsigned int osptimelimit; /*!< OSP call duration limit */
-#endif
struct sip_request initreq; /*!< Initial request that opened the SIP dialog */
int maxtime; /*!< Max time for first response */
@@ -1514,7 +1498,8 @@
if (recordhistory) {
struct sip_request tmp;
parse_copy(&tmp, req);
- append_history(p, reliable ? "TxRespRel" : "TxResp", "%s / %s", tmp.data, get_header(&tmp, "CSeq"));
+ append_history(p, reliable ? "TxRespRel" : "TxResp", "%s / %s - %s", tmp.data, get_header(&tmp, "CSeq"),
+ tmp.method == SIP_RESPONSE ? tmp.rlPart2 : sip_methods[tmp.method].text);
}
res = (reliable) ?
__sip_reliable_xmit(p, seqno, 1, req->data, req->len, (reliable == XMIT_CRITICAL), req->method) :
@@ -1539,7 +1524,7 @@
if (recordhistory) {
struct sip_request tmp;
parse_copy(&tmp, req);
- append_history(p, reliable ? "TxReqRel" : "TxReq", "%s / %s", tmp.data, get_header(&tmp, "CSeq"));
+ append_history(p, reliable ? "TxReqRel" : "TxReq", "%s / %s - %s", tmp.data, get_header(&tmp, "CSeq"), sip_methods[tmp.method].text);
}
res = (reliable) ?
__sip_reliable_xmit(p, seqno, 0, req->data, req->len, (reliable > 1), req->method) :
@@ -2034,9 +2019,6 @@
{
int res;
struct sip_pvt *p;
-#ifdef OSP_SUPPORT
- const char *osphandle = NULL;
-#endif
struct varshead *headp;
struct ast_var_t *current;
@@ -2061,30 +2043,12 @@
/* Check whether there is a variable with a name starting with SIPADDHEADER */
p->options->addsipheaders = 1;
}
-
-
-#ifdef OSP_SUPPORT
- else if (!p->options->osptoken && !strcasecmp(ast_var_name(current), "OSPTOKEN")) {
- p->options->osptoken = ast_var_value(current);
- } else if (!osphandle && !strcasecmp(ast_var_name(current), "OSPHANDLE")) {
- osphandle = ast_var_value(current);
- }
-#endif
}
res = 0;
ast_set_flag(&p->flags[0], SIP_OUTGOING);
-#ifdef OSP_SUPPORT
- if (!p->options->osptoken || !osphandle || (sscanf(osphandle, "%d", &p->osphandle) != 1)) {
- /* Force Disable OSP support */
- if (option_debug)
- ast_log(LOG_DEBUG, "Disabling OSP support for this call. osptoken = %s, osphandle = %s\n", p->options->osptoken, osphandle);
- p->options->osptoken = NULL;
- osphandle = NULL;
- p->osphandle = -1;
- }
-#endif
- ast_log(LOG_DEBUG, "Outgoing Call for %s\n", p->username);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Outgoing Call for %s\n", p->username);
res = update_call_counter(p, INC_CALL_LIMIT);
if ( res != -1 ) {
p->callingpres = ast->cid.cid_pres;
@@ -2482,11 +2446,6 @@
ast_log(LOG_DEBUG, "Hangup call %s, SIP callid %s)\n", ast->name, p->callid);
ast_mutex_lock(&p->lock);
-#ifdef OSP_SUPPORT
- if ((p->osphandle > -1) && (ast->_state == AST_STATE_UP)) {
- ast_osp_terminate(p->osphandle, AST_CAUSE_NORMAL, p->ospstart, time(NULL) - p->ospstart);
- }
-#endif
if (option_debug && sipdebug)
ast_log(LOG_DEBUG, "update_call_counter(%s) - decrement call limit counter on hangup\n", p->username);
update_call_counter(p, DEC_CALL_LIMIT);
@@ -2590,9 +2549,6 @@
ast_mutex_lock(&p->lock);
if (ast->_state != AST_STATE_UP) {
-#ifdef OSP_SUPPORT
- time(&p->ospstart);
-#endif
try_suggested_sip_codec(p);
ast_setstate(ast, AST_STATE_UP);
@@ -2820,10 +2776,6 @@
struct ast_variable *v = NULL;
int fmt;
int what;
-#ifdef OSP_SUPPORT
- char iabuf[INET_ADDRSTRLEN];
- char peer[MAXHOSTNAMELEN];
-#endif
ast_mutex_unlock(&i->lock);
/* Don't hold a sip pvt lock while we allocate a channel */
@@ -2913,10 +2865,6 @@
if (!ast_strlen_zero(i->callid)) {
pbx_builtin_setvar_helper(tmp, "SIPCALLID", i->callid);
}
-#ifdef OSP_SUPPORT
- snprintf(peer, sizeof(peer), "[%s]:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), i->sa.sin_addr), ntohs(i->sa.sin_port));
- pbx_builtin_setvar_helper(tmp, "OSPPEER", peer);
-#endif
ast_setstate(tmp, state);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
@@ -3164,10 +3112,6 @@
if (intended_method != SIP_OPTIONS) /* Peerpoke has it's own system */
p->timer_t1 = 500; /* Default SIP retransmission timer T1 (RFC 3261) */
-#ifdef OSP_SUPPORT
- p->osphandle = -1;
- p->osptimelimit = 0;
-#endif
if (sin) {
p->sa = *sin;
if (ast_sip_ouraddrfor(&p->sa.sin_addr,&p->ourip))
@@ -4741,6 +4685,8 @@
add_header(&req, "Allow", ALLOWED_METHODS);
if (sipdebug)
add_header(&req, "X-asterisk-info", "SIP re-invite (RTP bridge)");
+ if (recordhistory)
+ append_history(p, "%s", "Re-invite sent");
add_sdp(&req, p);
/* Use this as the basis */
copy_request(&p->initreq, &req);
@@ -5028,12 +4974,6 @@
if (!ast_strlen_zero(p->referred_by))
add_header(&req, "Referred-By", p->referred_by);
}
-#ifdef OSP_SUPPORT
- if ((req.method != SIP_OPTIONS) && p->options && !ast_strlen_zero(p->options->osptoken)) {
- ast_log(LOG_DEBUG,"Adding OSP Token: %s\n", p->options->osptoken);
- add_header(&req, "P-OSP-Auth-Token", p->options->osptoken);
- }
-#endif
if (p->options && !ast_strlen_zero(p->options->distinctive_ring))
{
add_header(&req, "Alert-Info", p->options->distinctive_ring);
@@ -6238,21 +6178,6 @@
list_route(p->route);
}
-#ifdef OSP_SUPPORT
-/*! \brief Validate OSP token for user authorization */
-static int check_osptoken (struct sip_pvt *p, char *token)
-{
- char tmp[80];
-
- if (ast_osp_validate (NULL, token, &p->osphandle, &p->osptimelimit, p->cid_num, p->sa.sin_addr, p->exten) < 1) {
- return -1;
- } else {
- snprintf (tmp, sizeof (tmp), "%d", p->osphandle);
- pbx_builtin_setvar_helper (p->owner, "_OSPHANDLE", tmp);
- return 0;
- }
-}
-#endif
/*! \brief Check user authorization from peer definition
Some actions, like REGISTER and INVITEs from peers require
@@ -6270,12 +6195,7 @@
const char *authtoken;
/* Always OK if no secret */
- if (ast_strlen_zero(secret) && ast_strlen_zero(md5secret)
-#ifdef OSP_SUPPORT
- && !ast_test_flag(&p->flags[0], SIP_OSPAUTH)
- && global_allowguest != 2
-#endif
- )
+ if (ast_strlen_zero(secret) && ast_strlen_zero(md5secret))
return 0;
if (sipmethod == SIP_REGISTER || sipmethod == SIP_SUBSCRIBE) {
/* On a REGISTER, we have to use 401 and its family of headers instead of 407 and its family
@@ -6285,38 +6205,6 @@
reqheader = "Authorization";
respheader = "WWW-Authenticate";
}
-#ifdef OSP_SUPPORT
- else {
- char *osptoken;
- if (option_debug)
- ast_log (LOG_DEBUG, "Checking OSP Authentication!\n");
- osptoken = get_header (req, "P-OSP-Auth-Token");
- switch (ast_test_flag(&p->flags[0], SIP_OSPAUTH)) {
- case SIP_OSPAUTH_NO:
- break;
- case SIP_OSPAUTH_GATEWAY:
- if (ast_strlen_zero(osptoken)) {
- if (ast_strlen_zero(secret) && ast_strlen_zero (md5secret))
- return 0;
- } else {
- return check_osptoken(p, osptoken);
- }
- break;
- case SIP_OSPAUTH_PROXY:
- if (ast_strlen_zero(osptoken))
- return 0;
- return check_osptoken(p, osptoken);
- break;
- case SIP_OSPAUTH_EXCLUSIVE:
- if (ast_strlen_zero(osptoken))
- return -1;
- return check_osptoken(p, osptoken);
- break;
- default:
- return -1;
- }
- }
-#endif
authtoken = get_header(req, reqheader);
if (ignore && !ast_strlen_zero(p->randdata) && ast_strlen_zero(authtoken)) {
/* This is a retransmitted invite/register/etc, don't reconstruct authentication
@@ -8328,11 +8216,6 @@
ast_cli(fd, " IP ToS SIP: %s\n", ast_tos2str(global_tos_sip));
ast_cli(fd, " IP ToS RTP audio: %s\n", ast_tos2str(global_tos_audio));
ast_cli(fd, " IP ToS RTP video: %s\n", ast_tos2str(global_tos_video));
-#ifdef OSP_SUPPORT
- ast_cli(fd, " OSP Support: Yes\n");
-#else
- ast_cli(fd, " OSP Support: No\n");
-#endif
if (!realtimepeers && !realtimeusers)
ast_cli(fd, " SIP realtime: Disabled\n" );
else
@@ -9649,9 +9532,6 @@
if (!ignore && p->owner) {
if (p->owner->_state != AST_STATE_UP) {
-#ifdef OSP_SUPPORT
- time(&p->ospstart);
-#endif
ast_queue_control(p->owner, AST_CONTROL_ANSWER);
} else { /* RE-invite */
ast_queue_frame(p->owner, &ast_null_frame);
@@ -9691,7 +9571,7 @@
case 403: /* Forbidden */
[... 2075 lines stripped ...]
More information about the asterisk-commits
mailing list