summaryrefslogtreecommitdiff
path: root/apps/app_osplookup.c
diff options
context:
space:
mode:
authorTransNexus OSP Development <support@transnexus.com>2009-04-30 07:20:59 +0000
committerTransNexus OSP Development <support@transnexus.com>2009-04-30 07:20:59 +0000
commit236920485d2e3ecbf0a1fbcf2332d97477a5bd75 (patch)
treef82f094b6aec584ca632160c3b55f82f29c1f04f /apps/app_osplookup.c
parent4cbe6b1afe6f26ecdc7aa4080e09946b55a01720 (diff)
Fixed not report source network ID and not export destination network ID issues.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_osplookup.c')
-rw-r--r--apps/app_osplookup.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index 597392616..3a15974c3 100644
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -849,6 +849,7 @@ static int osp_create_callid(
* \param srcdev Source device of outbound call
* \param calling Calling number
* \param called Called number
+ * \param snetid Source network ID
* \param callidtypes Call ID types
* \param result Lookup results
* \return 1 Found , 0 No route, -1 Error
@@ -858,6 +859,7 @@ static int osp_lookup(
const char* srcdev,
const char* calling,
const char* called,
+ const char* snetid,
unsigned int callidtypes,
struct osp_result* result)
{
@@ -903,6 +905,10 @@ static int osp_lookup(
return -1;
}
+ if (!ast_strlen_zero(snetid)) {
+ OSPPTransactionSetNetworkIds(result->outhandle, snetid, "");
+ }
+
callidnum = 0;
callids[0] = NULL;
for (i = 0; i < OSP_CALLID_MAXNUM; i++) {
@@ -1414,7 +1420,7 @@ static int osplookup_exec(
return -1;
}
- if ((res = osp_lookup(provider, srcdev, chan->cid.cid_num, args.exten, callidtypes, &result)) > 0) {
+ if ((res = osp_lookup(provider, srcdev, chan->cid.cid_num, args.exten, snetid, callidtypes, &result)) > 0) {
status = AST_OSP_SUCCESS;
} else {
result.tech[0] = '\0';
@@ -1445,6 +1451,8 @@ static int osplookup_exec(
ast_debug(1, "OSPLookup: OSPCALLED '%s'\n", result.called);
pbx_builtin_setvar_helper(chan, "OSPCALLING", result.calling);
ast_debug(1, "OSPLookup: OSPCALLING '%s'\n", result.calling);
+ pbx_builtin_setvar_helper(chan, "OSPOUTNETWORKID", result.networkid);
+ ast_debug(1, "OSPLookup: OSPOUTNETWORKID '%s'\n", result.networkid);
pbx_builtin_setvar_helper(chan, "OSPOUTTOKEN", result.token);
ast_debug(1, "OSPLookup: OSPOUTTOKEN size '%zd'\n", strlen(result.token));
snprintf(buffer, sizeof(buffer), "%d", result.numresults);
@@ -1606,6 +1614,8 @@ static int ospnext_exec(
ast_debug(1, "OSPNext: OSPCALLED'%s'\n", result.called);
pbx_builtin_setvar_helper(chan, "OSPCALLING", result.calling);
ast_debug(1, "OSPNext: OSPCALLING '%s'\n", result.calling);
+ pbx_builtin_setvar_helper(chan, "OSPOUTNETWORKID", result.networkid);
+ ast_debug(1, "OSPLookup: OSPOUTNETWORKID '%s'\n", result.networkid);
pbx_builtin_setvar_helper(chan, "OSPOUTTOKEN", result.token);
ast_debug(1, "OSPNext: OSPOUTTOKEN size '%zd'\n", strlen(result.token));
snprintf(buffer, sizeof(buffer), "%d", result.numresults);