mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Added routing number support.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -850,6 +850,7 @@ static int osp_create_callid(
|
|||||||
* \param calling Calling number
|
* \param calling Calling number
|
||||||
* \param called Called number
|
* \param called Called number
|
||||||
* \param snetid Source network ID
|
* \param snetid Source network ID
|
||||||
|
* \param rnumber Routing number
|
||||||
* \param callidtypes Call ID types
|
* \param callidtypes Call ID types
|
||||||
* \param result Lookup results
|
* \param result Lookup results
|
||||||
* \return 1 Found , 0 No route, -1 Error
|
* \return 1 Found , 0 No route, -1 Error
|
||||||
@@ -860,6 +861,7 @@ static int osp_lookup(
|
|||||||
const char* calling,
|
const char* calling,
|
||||||
const char* called,
|
const char* called,
|
||||||
const char* snetid,
|
const char* snetid,
|
||||||
|
const char* rnumber,
|
||||||
unsigned int callidtypes,
|
unsigned int callidtypes,
|
||||||
struct osp_result* result)
|
struct osp_result* result)
|
||||||
{
|
{
|
||||||
@@ -909,6 +911,10 @@ static int osp_lookup(
|
|||||||
OSPPTransactionSetNetworkIds(result->outhandle, snetid, "");
|
OSPPTransactionSetNetworkIds(result->outhandle, snetid, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ast_strlen_zero(rnumber)) {
|
||||||
|
OSPPTransactionSetRoutingNumber(result->outhandle, rnumber);
|
||||||
|
}
|
||||||
|
|
||||||
callidnum = 0;
|
callidnum = 0;
|
||||||
callids[0] = NULL;
|
callids[0] = NULL;
|
||||||
for (i = 0; i < OSP_CALLID_MAXNUM; i++) {
|
for (i = 0; i < OSP_CALLID_MAXNUM; i++) {
|
||||||
@@ -1348,6 +1354,7 @@ static int osplookup_exec(
|
|||||||
struct ast_var_t* current;
|
struct ast_var_t* current;
|
||||||
const char* srcdev = "";
|
const char* srcdev = "";
|
||||||
const char* snetid = "";
|
const char* snetid = "";
|
||||||
|
const char* rnumber = "";
|
||||||
char buffer[OSP_TOKSTR_SIZE];
|
char buffer[OSP_TOKSTR_SIZE];
|
||||||
unsigned int callidtypes = OSP_CALLID_UNDEFINED;
|
unsigned int callidtypes = OSP_CALLID_UNDEFINED;
|
||||||
struct osp_result result;
|
struct osp_result result;
|
||||||
@@ -1407,6 +1414,8 @@ static int osplookup_exec(
|
|||||||
}
|
}
|
||||||
} else if (!strcasecmp(ast_var_name(current), "OSPINNETWORKID")) {
|
} else if (!strcasecmp(ast_var_name(current), "OSPINNETWORKID")) {
|
||||||
snetid = ast_var_value(current);
|
snetid = ast_var_value(current);
|
||||||
|
} else if (!strcasecmp(ast_var_name(current), "OSPROUTINGNUMBER")) {
|
||||||
|
rnumber = ast_var_value(current);
|
||||||
} else if (!strcasecmp(ast_var_name(current), "OSPPEERIP")) {
|
} else if (!strcasecmp(ast_var_name(current), "OSPPEERIP")) {
|
||||||
srcdev = ast_var_value(current);
|
srcdev = ast_var_value(current);
|
||||||
}
|
}
|
||||||
@@ -1414,13 +1423,14 @@ static int osplookup_exec(
|
|||||||
ast_debug(1, "OSPLookup: OSPINHANDLE '%d'\n", result.inhandle);
|
ast_debug(1, "OSPLookup: OSPINHANDLE '%d'\n", result.inhandle);
|
||||||
ast_debug(1, "OSPLookup: OSPINTIMELIMIT '%d'\n", result.intimelimit);
|
ast_debug(1, "OSPLookup: OSPINTIMELIMIT '%d'\n", result.intimelimit);
|
||||||
ast_debug(1, "OSPLookup: OSPINNETWORKID '%s'\n", snetid);
|
ast_debug(1, "OSPLookup: OSPINNETWORKID '%s'\n", snetid);
|
||||||
|
ast_debug(1, "OSPLookup: OSPROUTINGNUMBER '%s'\n", rnumber);
|
||||||
ast_debug(1, "OSPLookup: source device '%s'\n", srcdev);
|
ast_debug(1, "OSPLookup: source device '%s'\n", srcdev);
|
||||||
|
|
||||||
if ((cres = ast_autoservice_start(chan)) < 0) {
|
if ((cres = ast_autoservice_start(chan)) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((res = osp_lookup(provider, srcdev, chan->cid.cid_num, args.exten, snetid, callidtypes, &result)) > 0) {
|
if ((res = osp_lookup(provider, srcdev, chan->cid.cid_num, args.exten, snetid, rnumber, callidtypes, &result)) > 0) {
|
||||||
status = AST_OSP_SUCCESS;
|
status = AST_OSP_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
result.tech[0] = '\0';
|
result.tech[0] = '\0';
|
||||||
|
Reference in New Issue
Block a user