From 45f4d985adb212fbd879343a16d79d61474d3361 Mon Sep 17 00:00:00 2001 From: transnexus Date: Thu, 30 Apr 2009 09:11:23 +0000 Subject: Added routing number support. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191332 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_osplookup.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'apps/app_osplookup.c') 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'; -- cgit v1.2.3