aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-12 14:46:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-12 14:46:10 +0000
commitba055c53127a0824626978c07f96304b46523222 (patch)
tree542526561d24fc2efbc872530e6fca8463d0e843
parent4c877409fc1b9390d6e113ffeb0fdc1b71233147 (diff)
First pass at properly handling account codes in forwarding
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3418 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_dial.c7
-rwxr-xr-xchannels/chan_local.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 0c887a7aa..6530402f3 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -214,7 +214,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, o->chan->name);
/* Setup parameters */
- ast_hangup(o->chan);
o->chan = ast_request(tech, in->nativeformats, stuff);
if (!o->chan) {
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s'\n", tech, stuff);
@@ -234,6 +233,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
else
newcid = in->exten;
o->chan->callerid = strdup(newcid);
+ strncpy(o->chan->accountcode, winner->accountcode, sizeof(o->chan->accountcode) - 1);
+ o->chan->cdrflags = winner->cdrflags;
if (!o->chan->callerid)
ast_log(LOG_WARNING, "Out of memory\n");
} else {
@@ -241,6 +242,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
o->chan->callerid = strdup(in->callerid);
if (!o->chan->callerid)
ast_log(LOG_WARNING, "Out of memory\n");
+ strncpy(o->chan->accountcode, in->accountcode, sizeof(o->chan->accountcode) - 1);
+ o->chan->cdrflags = in->cdrflags;
}
if (in->ani) {
@@ -266,6 +269,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
numnochan++;
}
}
+ /* Hangup the original channel now, in case we needed it */
+ ast_hangup(winner);
continue;
}
f = ast_read(winner);
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 758777a85..fc8fd8820 100755
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -252,6 +252,9 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
else
p->chan->ani = NULL;
strncpy(p->chan->language, p->owner->language, sizeof(p->chan->language) - 1);
+ strncpy(p->chan->accountcode, p->owner->accountcode, sizeof(p->chan->accountcode) - 1);
+ p->chan->cdrflags = p->owner->cdrflags;
+
p->launchedpbx = 1;
/* Start switch on sub channel */
res = ast_pbx_start(p->chan);