diff options
author | Matthew Fredrickson <creslin@digium.com> | 2006-03-23 21:41:23 +0000 |
---|---|---|
committer | Matthew Fredrickson <creslin@digium.com> | 2006-03-23 21:41:23 +0000 |
commit | ba8f7b881952b4052fb86d6ff93a3fb0607860d3 (patch) | |
tree | 9bb4d82a9267b68bab5d95a2683d0471ee0c0a57 | |
parent | be537d95eba7f75e614902a2ad5668e8e8334510 (diff) |
Allow channels to be moved if channel change is requested in SETUP_ACK, also add a WAY cool new field to the nsf option
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@14521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_zap.c | 24 | ||||
-rw-r--r-- | configs/zapata.conf.sample | 2 |
2 files changed, 16 insertions, 10 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 1fb0b87c6..6858435ce 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -9249,15 +9249,19 @@ static void *pri_dchannel(void *vpri) ast_log(LOG_WARNING, "Received SETUP_ACKNOWLEDGE on unconfigured channel %d/%d span %d\n", PRI_SPAN(e->setup_ack.channel), PRI_CHANNEL(e->setup_ack.channel), pri->span); } else { - ast_mutex_lock(&pri->pvts[chanpos]->lock); - pri->pvts[chanpos]->setup_ack = 1; - /* Send any queued digits */ - for (x=0;x<strlen(pri->pvts[chanpos]->dialdest);x++) { - ast_log(LOG_DEBUG, "Sending pending digit '%c'\n", pri->pvts[chanpos]->dialdest[x]); - pri_information(pri->pri, pri->pvts[chanpos]->call, - pri->pvts[chanpos]->dialdest[x]); - } - ast_mutex_unlock(&pri->pvts[chanpos]->lock); + chanpos = pri_fixup_principle(pri, chanpos, e->ring.call); + if (chanpos > -1) { + ast_mutex_lock(&pri->pvts[chanpos]->lock); + pri->pvts[chanpos]->setup_ack = 1; + /* Send any queued digits */ + for (x=0;x<strlen(pri->pvts[chanpos]->dialdest);x++) { + ast_log(LOG_DEBUG, "Sending pending digit '%c'\n", pri->pvts[chanpos]->dialdest[x]); + pri_information(pri->pri, pri->pvts[chanpos]->call, + pri->pvts[chanpos]->dialdest[x]); + } + ast_mutex_unlock(&pri->pvts[chanpos]->lock); + } else + ast_log(LOG_WARNING, "Unable to move channel %d!\n", e->setup_ack.channel); } break; case PRI_EVENT_NOTIFY: @@ -10973,6 +10977,8 @@ static int setup_zap(int reload) nsf = PRI_NSF_SDN; else if (!strcasecmp(v->value, "megacom")) nsf = PRI_NSF_MEGACOM; + else if (!strcasecmp(v->value, "tollfreemegacom")) + nsf = PRI_NSF_TOLL_FREE_MEGACOM; else if (!strcasecmp(v->value, "accunet")) nsf = PRI_NSF_ACCUNET; else if (!strcasecmp(v->value, "none")) diff --git a/configs/zapata.conf.sample b/configs/zapata.conf.sample index 8a283ce4a..0ab51441f 100644 --- a/configs/zapata.conf.sample +++ b/configs/zapata.conf.sample @@ -62,7 +62,7 @@ context=default switchtype=national ; ; Some switches (AT&T especially) require network specific facility IE -; supported values are currently 'none', 'sdn', 'megacom', 'accunet' +; supported values are currently 'none', 'sdn', 'megacom', 'tollfreemegacom', 'accunet' ; ;nsf=none ; |