[asterisk-commits] moy: branch moy/mfcr2-1.4 r132376 - /team/moy/mfcr2-1.4/channels/chan_zap.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jul 20 01:25:35 CDT 2008
Author: moy
Date: Sun Jul 20 01:25:35 2008
New Revision: 132376
URL: http://svn.digium.com/view/asterisk?view=rev&rev=132376
Log:
minor fixes for restricted ANI and logging format of mfcr2 show channels
Modified:
team/moy/mfcr2-1.4/channels/chan_zap.c
Modified: team/moy/mfcr2-1.4/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2-1.4/channels/chan_zap.c?view=diff&rev=132376&r1=132375&r2=132376
==============================================================================
--- team/moy/mfcr2-1.4/channels/chan_zap.c (original)
+++ team/moy/mfcr2-1.4/channels/chan_zap.c Sun Jul 20 01:25:35 2008
@@ -943,7 +943,7 @@
{
struct zt_pvt *p;
ast_log(LOG_NOTICE, "MFC/R2 call offered on chan %d. DNIS = %s, ANI = %s, Category = %s\n",
- openr2_chan_get_number(r2chan), dnis, ani, openr2_proto_get_category_string(category));
+ openr2_chan_get_number(r2chan), dnis, ani ? ani : "(restricted)", openr2_proto_get_category_string(category));
p = openr2_chan_get_client_data(r2chan);
if (!p->mfcr2_allow_collect_calls && category == OR2_CALLING_PARTY_CATEGORY_COLLECT_CALL) {
ast_log(LOG_NOTICE, "Rejecting MFC/R2 collect call\n");
@@ -960,12 +960,12 @@
p->cid_num[0] = 0;
}
ast_copy_string(p->rdnis, dnis, sizeof(p->rdnis));
- if (p->immediate || !openr2_context_get_max_dnis(openr2_chan_get_context(r2chan))) {
- ast_log(LOG_DEBUG, "setting exten => s because of immediate or 0 DNIS configured\n");
- ast_copy_string(p->exten, "s", sizeof(p->exten));
- } else {
- ast_copy_string(p->exten, dnis, sizeof(p->exten));
- }
+ if (p->immediate || !openr2_context_get_max_dnis(openr2_chan_get_context(r2chan))) {
+ ast_log(LOG_DEBUG, "setting exten => s because of immediate or 0 DNIS configured\n");
+ ast_copy_string(p->exten, "s", sizeof(p->exten));
+ } else {
+ ast_copy_string(p->exten, dnis, sizeof(p->exten));
+ }
ast_mutex_unlock(&p->lock);
if (!ast_exists_extension(NULL, p->context, p->exten, 1, p->cid_num)) {
ast_log(LOG_NOTICE, "MFC/R2 call on channel %d requested non-existent extension '%s' in context '%s'. Rejecting call.\n",
@@ -1070,6 +1070,8 @@
ast_log(LOG_NOTICE, "MFC/R2 call disconnected on chan %d\n", openr2_chan_get_number(r2chan));
ast_mutex_lock(&p->lock);
if (p->owner) {
+ /* when we have an owner we don't call openr2_chan_disconnect_call here, that will
+ be done in zt_hangup */
if (p->owner->_state == AST_STATE_UP) {
p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
ast_mutex_unlock(&p->lock);
@@ -1098,7 +1100,7 @@
ast_queue_hangup(p->owner);
}
} else {
- /* no owner, let's just disconnect our side */
+ /* no owner, therefore we can't use zt_hangup to disconnect, do it right now */
openr2_chan_disconnect_call(r2chan, OR2_CAUSE_NORMAL_CLEARING);
}
}
@@ -10476,7 +10478,7 @@
static int handle_mfcr2_show_channels(int fd, int argc, char *argv[])
{
-#define FORMAT "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-20.20s %-10.10s %-10.10s\n"
+#define FORMAT "%4s %-7.7s %-7.7s %-8.8s %-9.9s %-16.16s %-8.8s %-8.8s\n"
int filtertype = 0;
int targetnum = 0;
char channo[5];
More information about the asterisk-commits
mailing list