diff options
author | transnexus <transnexus@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-30 09:11:23 +0000 |
---|---|---|
committer | transnexus <transnexus@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-30 09:11:23 +0000 |
commit | 45f4d985adb212fbd879343a16d79d61474d3361 (patch) | |
tree | 0e42877f549542a5c5ed6f8b6dbdcee1b9d6b60a /apps/app_osplookup.c | |
parent | 764c816e0c4106dc0c1809d7e044356fcf54cdd1 (diff) |
Added routing number support.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191332 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_osplookup.c')
-rw-r--r-- | apps/app_osplookup.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c index 3a15974c3..c6e11e823 100644 --- a/apps/app_osplookup.c +++ b/apps/app_osplookup.c @@ -850,6 +850,7 @@ static int osp_create_callid( * \param calling Calling number * \param called Called number * \param snetid Source network ID + * \param rnumber Routing number * \param callidtypes Call ID types * \param result Lookup results * \return 1 Found , 0 No route, -1 Error @@ -860,6 +861,7 @@ static int osp_lookup( const char* calling, const char* called, const char* snetid, + const char* rnumber, unsigned int callidtypes, struct osp_result* result) { @@ -909,6 +911,10 @@ static int osp_lookup( OSPPTransactionSetNetworkIds(result->outhandle, snetid, ""); } + if (!ast_strlen_zero(rnumber)) { + OSPPTransactionSetRoutingNumber(result->outhandle, rnumber); + } + callidnum = 0; callids[0] = NULL; for (i = 0; i < OSP_CALLID_MAXNUM; i++) { @@ -1348,6 +1354,7 @@ static int osplookup_exec( struct ast_var_t* current; const char* srcdev = ""; const char* snetid = ""; + const char* rnumber = ""; char buffer[OSP_TOKSTR_SIZE]; unsigned int callidtypes = OSP_CALLID_UNDEFINED; struct osp_result result; @@ -1407,6 +1414,8 @@ static int osplookup_exec( } } else if (!strcasecmp(ast_var_name(current), "OSPINNETWORKID")) { 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")) { 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: OSPINTIMELIMIT '%d'\n", result.intimelimit); 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); if ((cres = ast_autoservice_start(chan)) < 0) { 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; } else { result.tech[0] = '\0'; |