[asterisk-commits] moy: branch moy/mfcr2 r115560 - /team/moy/mfcr2/channels/chan_zap.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 8 11:09:25 CDT 2008


Author: moy
Date: Thu May  8 11:09:24 2008
New Revision: 115560

URL: http://svn.digium.com/view/asterisk?view=rev&rev=115560
Log:
added support for immediate=yes and proper handling of DNIS=0

Modified:
    team/moy/mfcr2/channels/chan_zap.c

Modified: team/moy/mfcr2/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/channels/chan_zap.c?view=diff&rev=115560&r1=115559&r2=115560
==============================================================================
--- team/moy/mfcr2/channels/chan_zap.c (original)
+++ team/moy/mfcr2/channels/chan_zap.c Thu May  8 11:09:24 2008
@@ -1319,7 +1319,12 @@
 		p->cid_num[0] = 0;
 	}
 	ast_copy_string(p->rdnis, dnis, sizeof(p->rdnis));
-	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",
@@ -14979,7 +14984,8 @@
 				}
 			} else if (!strcasecmp(v->name, "mfcr2_logging")) {
 				openr2_log_level_t tmplevel;
-				char *toklevel, *saveptr;
+				char *toklevel = NULL;
+				char *saveptr = NULL;
 				char *logval = ast_strdupa(v->value);
 				toklevel = strtok_r(logval, ",", &saveptr);
 				if (-1 == (tmplevel = openr2_log_get_level(toklevel))) {




More information about the asterisk-commits mailing list