[asterisk-commits] rmudgett: branch rmudgett/dahdi_deflection r223956 - in /team/rmudgett/dahdi_...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Oct 13 16:00:53 CDT 2009
Author: rmudgett
Date: Tue Oct 13 16:00:48 2009
New Revision: 223956
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=223956
Log:
Initial keypad facility in SETUP support.
Modified:
team/rmudgett/dahdi_deflection/channels/sig_pri.c
team/rmudgett/dahdi_deflection/channels/sig_pri.h
team/rmudgett/dahdi_deflection/configure.ac
Modified: team/rmudgett/dahdi_deflection/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/dahdi_deflection/channels/sig_pri.c?view=diff&rev=223956&r1=223955&r2=223956
==============================================================================
--- team/rmudgett/dahdi_deflection/channels/sig_pri.c (original)
+++ team/rmudgett/dahdi_deflection/channels/sig_pri.c Tue Oct 13 16:00:48 2009
@@ -2252,6 +2252,12 @@
#if defined(HAVE_PRI_REVERSE_CHARGE)
pri->pvts[chanpos]->reverse_charging_indication = e->ring.reversecharge;
#endif
+#if defined(HAVE_PRI_SETUP_KEYPAD)
+ if (!ast_strlen_zero(e->ring.keypad_digits)) {
+ pbx_builtin_setvar_helper(c, "PRI_KEYPAD",
+ e->ring.keypad_digits);
+ }
+#endif /* defined(HAVE_PRI_SETUP_KEYPAD) */
sig_pri_handle_subcmds(pri, chanpos, e->e, e->ring.channel,
e->ring.subcmds, e->ring.call);
@@ -2312,6 +2318,12 @@
#if defined(HAVE_PRI_REVERSE_CHARGE)
pri->pvts[chanpos]->reverse_charging_indication = e->ring.reversecharge;
#endif
+#if defined(HAVE_PRI_SETUP_KEYPAD)
+ if (!ast_strlen_zero(e->ring.keypad_digits)) {
+ pbx_builtin_setvar_helper(c, "PRI_KEYPAD",
+ e->ring.keypad_digits);
+ }
+#endif /* defined(HAVE_PRI_SETUP_KEYPAD) */
snprintf(calledtonstr, sizeof(calledtonstr), "%d", e->ring.calledplan);
pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
@@ -2968,6 +2980,9 @@
int prilocaldialplan;
int ldp_strip;
int exclusive;
+#if defined(HAVE_PRI_SETUP_KEYPAD)
+ const char *keypad = NULL;
+#endif /* defined(HAVE_PRI_SETUP_KEYPAD) */
ast_log(LOG_DEBUG, "CALLING CID_NAME: %s CID_NUM:: %s\n", ast->cid.cid_name, ast->cid.cid_num);
@@ -3107,6 +3122,12 @@
pri_sr_set_reversecharge(sr, PRI_REVERSECHARGE_REQUESTED);
break;
#endif
+#if defined(HAVE_PRI_SETUP_KEYPAD)
+ case 'K':
+ /* The digits to dial are keypad facility digits. */
+ keypad = c;
+ break;
+#endif /* defined(HAVE_PRI_SETUP_KEYPAD) */
default:
if (isalpha(c[p->stripmsd])) {
ast_log(LOG_WARNING, "Unrecognized pridialplan %s modifier: %c\n",
@@ -3116,7 +3137,18 @@
}
c++;
}
- pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan, s ? 1 : 0);
+#if defined(HAVE_PRI_SETUP_KEYPAD)
+ if (keypad) {
+ /* The digits to dial are keypad facility digits. */
+ keypad = c + p->stripmsd;
+ }
+ if (!ast_strlen_zero(keypad)) {
+ pri_sr_set_keypad_digits(sr, keypad);
+ } else
+#endif /* defined(HAVE_PRI_SETUP_KEYPAD) */
+ {
+ pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan, s ? 1 : 0);
+ }
ldp_strip = 0;
prilocaldialplan = p->pri->localdialplan - 1;
Modified: team/rmudgett/dahdi_deflection/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/dahdi_deflection/channels/sig_pri.h?view=diff&rev=223956&r1=223955&r2=223956
==============================================================================
--- team/rmudgett/dahdi_deflection/channels/sig_pri.h (original)
+++ team/rmudgett/dahdi_deflection/channels/sig_pri.h Tue Oct 13 16:00:48 2009
@@ -31,6 +31,7 @@
#include <dahdi/user.h>
#define HAVE_PRI_CALL_HOLD 1 /* BUGBUG remove this line and put test in configure.ac */
#define HAVE_PRI_CALL_REROUTING 1 /* BUGBUG remove this line and put test in configure.ac */
+#define HAVE_PRI_SETUP_KEYPAD 1 /* BUGBUG remove this line and put test in configure.ac */
enum sig_pri_tone {
SIG_PRI_TONE_RINGTONE = 0,
Modified: team/rmudgett/dahdi_deflection/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/dahdi_deflection/configure.ac?view=diff&rev=223956&r1=223955&r2=223956
==============================================================================
--- team/rmudgett/dahdi_deflection/configure.ac (original)
+++ team/rmudgett/dahdi_deflection/configure.ac Tue Oct 13 16:00:48 2009
@@ -290,6 +290,7 @@
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri])
+AST_EXT_LIB_SETUP_DEPENDENT([PRI_SETUP_KEYPAD], [ISDN PRI keypad facility in SETUP], [PRI], [pri])
# ------------------------------------v
# TODO: The code can be changed to always include these features now.
# These features will always be present if pri_connected_line_update is available.
@@ -1445,6 +1446,7 @@
AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h])
AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h])
AST_EXT_LIB_CHECK([PRI_CALL_REROUTING], [pri], [pri_reroute_enable], [libpri.h])
+AST_EXT_LIB_CHECK([PRI_SETUP_KEYPAD], [pri], [pri_sr_set_keypad_digits], [libpri.h])
# ------------------------------------v
# TODO: The code can be changed to always include these features now.
More information about the asterisk-commits
mailing list