summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Goncharovskiy <igor.goncharovsky@gmail.com>2012-07-18 07:17:00 +0000
committerIgor Goncharovskiy <igor.goncharovsky@gmail.com>2012-07-18 07:17:00 +0000
commit9278b5e51efe8a4083e1ff32052cb383e6a171ca (patch)
treef89e292af41d17b531a81d1ed1c3a441f960dd87
parentcd91570bc65f3fd182e3cca1ef6c01ee5756b94b (diff)
Added option 'interdigit_timer' to unistim.conf to make able controll hardcoded dial timeout constant.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--CHANGES3
-rw-r--r--channels/chan_unistim.c13
-rw-r--r--configs/unistim.conf.sample1
3 files changed, 13 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 3384196f7..fffdd5a45 100644
--- a/CHANGES
+++ b/CHANGES
@@ -140,6 +140,7 @@ Chan_unistim changes
configuration multiple lines can be defined, it allows to have multiple calls
on one phone, callwaiting and switching between calls.
* Added option 'sharpdial' allowing end dialing by pressing # key
+ * Added option 'interdigit_timer' for controll phone dial timeout
* Added options 'cwstyle', 'cwvolume' controlling callwaiting appearance
* Added global 'debug' option, that enables debug in channel driver
* Added ability for translation on-screen menu to multiple languages. Tested on
@@ -149,7 +150,7 @@ Chan_unistim changes
* In addition to English added French and Russian languages for on-screen menus
* Reworked dialing number input: added dialing by timeout, immediate dial on
on dialplan compare, phone number length now not limited by screen size
- * Added ability for pickup a call using fetures.conf defined value and
+ * Added ability for pickup a call using features.conf defined value and
on-screen key
Codec changes
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c
index fc9c8a867..e7317c140 100644
--- a/channels/chan_unistim.c
+++ b/channels/chan_unistim.c
@@ -99,8 +99,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define RETRANSMIT_TIMER 2000
/*! How often the mailbox is checked for new messages */
#define TIMER_MWI 5000
-/*! How often the mailbox is checked for new messages */
-#define TIMER_DIAL 4000
+/*! Timeout value for entered number being dialed */
+#define DEFAULT_INTERDIGIT_TIMER 4000
+
/*! Not used */
#define DEFAULT_CODEC 0x00
#define SIZE_PAGE 4096
@@ -399,6 +400,7 @@ static struct unistim_device {
char ringstyle; /*!< Ring melody */
char cwvolume; /*!< Ring volume on call waiting */
char cwstyle; /*!< Ring melody on call waiting */
+ int interdigit_timer; /*!< Interdigit timer for dialing number by timeout */
time_t nextdial; /*!< Timer used for dial by timeout */
int rtp_port; /*!< RTP port used by the phone */
int rtp_method; /*!< Select the unistim data used to establish a RTP session */
@@ -3475,7 +3477,9 @@ static void key_dial_page(struct unistimsession *pte, char keycode)
!ast_matchmore_extension(NULL, pte->device->context, pte->device->phone_number, 1, NULL)) {
keycode = KEY_FUNC1;
} else {
- pte->device->nextdial = get_tick_count() + TIMER_DIAL;
+ if (pte->device->interdigit_timer) {
+ pte->device->nextdial = get_tick_count() + pte->device->interdigit_timer;
+ }
}
}
if (keycode == KEY_FUNC4) {
@@ -6288,6 +6292,7 @@ static struct unistim_device *build_device(const char *cat, const struct ast_var
d->mute = MUTE_OFF;
d->height = DEFAULTHEIGHT;
d->selected = -1;
+ d->interdigit_timer = DEFAULT_INTERDIGIT_TIMER;
linelabel[0] = '\0';
dateformat = 1;
timeformat = 1;
@@ -6346,6 +6351,8 @@ static struct unistim_device *build_device(const char *cat, const struct ast_var
callhistory = atoi(v->value);
} else if (!strcasecmp(v->name, "sharpdial")) {
sharpdial = ast_true(v->value) ? 1 : 0;
+ } else if (!strcasecmp(v->name, "interdigit_timer")) {
+ d->interdigit_timer = atoi(v->value);
} else if (!strcasecmp(v->name, "callerid")) {
if (!strcasecmp(v->value, "asreceived")) {
lt->cid_num[0] = '\0';
diff --git a/configs/unistim.conf.sample b/configs/unistim.conf.sample
index 50a15f0ee..44d6e3e17 100644
--- a/configs/unistim.conf.sample
+++ b/configs/unistim.conf.sample
@@ -66,6 +66,7 @@ port=5000 ; UDP port
;cwvolume=2 ; ring volume : 0,1,2,3, default = 0
;cwstyle=3 ; ring style : 0 to 7, default = 2
;sharpdial=1 ; dial number by pressing #, default = 0
+;interdigit_timer=4000 ; timer for automatic dial after several digits of number entered (in ms, 0 is off)
;callhistory=1 ; 0 = disable, 1 = enable call history, default = 1
;callerid="Customer Support" <555-234-5678>
;context=default ; context, default="default"