mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
Add new variable for PRIREDIRECTREASON in dial plan if you a call is redirected
to you. Also some E&M tweaking parameters. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -157,6 +157,8 @@ static char *config = "zapata.conf";
|
|||||||
|
|
||||||
#define DCHAN_AVAILABLE (DCHAN_PROVISIONED | DCHAN_NOTINALARM | DCHAN_UP)
|
#define DCHAN_AVAILABLE (DCHAN_PROVISIONED | DCHAN_NOTINALARM | DCHAN_UP)
|
||||||
|
|
||||||
|
static int cur_emdigitwait = 250; /* Wait time in ms for digits on EM channel */
|
||||||
|
|
||||||
static char context[AST_MAX_EXTENSION] = "default";
|
static char context[AST_MAX_EXTENSION] = "default";
|
||||||
static char cid_num[256] = "";
|
static char cid_num[256] = "";
|
||||||
static char cid_name[256] = "";
|
static char cid_name[256] = "";
|
||||||
@@ -563,6 +565,7 @@ static struct zt_pvt {
|
|||||||
int dtmfrelax; /* whether to run in relaxed DTMF mode */
|
int dtmfrelax; /* whether to run in relaxed DTMF mode */
|
||||||
int fake_event;
|
int fake_event;
|
||||||
int zaptrcallerid; /* should we use the callerid from incoming call on zap transfer or not */
|
int zaptrcallerid; /* should we use the callerid from incoming call on zap transfer or not */
|
||||||
|
int emdigitwait;
|
||||||
int hanguponpolarityswitch;
|
int hanguponpolarityswitch;
|
||||||
int polarityonanswerdelay;
|
int polarityonanswerdelay;
|
||||||
struct timeval polaritydelaytv;
|
struct timeval polaritydelaytv;
|
||||||
@@ -4835,7 +4838,7 @@ static void *ss_thread(void *data)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* If we got it, get the rest */
|
/* If we got it, get the rest */
|
||||||
res = my_getsigstr(chan,dtmfbuf + 1,' ',250);
|
res = my_getsigstr(chan,dtmfbuf + 1,' ', p->emdigitwait);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6592,6 +6595,7 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio, struct zt_p
|
|||||||
tmp->restrictcid = restrictcid;
|
tmp->restrictcid = restrictcid;
|
||||||
tmp->use_callingpres = use_callingpres;
|
tmp->use_callingpres = use_callingpres;
|
||||||
tmp->priindication_oob = priindication_oob;
|
tmp->priindication_oob = priindication_oob;
|
||||||
|
tmp->emdigitwait = cur_emdigitwait;
|
||||||
if (tmp->usedistinctiveringdetection) {
|
if (tmp->usedistinctiveringdetection) {
|
||||||
if (!tmp->use_callerid) {
|
if (!tmp->use_callerid) {
|
||||||
ast_log(LOG_NOTICE, "Distinctive Ring detect requires 'usecallerid' be on\n");
|
ast_log(LOG_NOTICE, "Distinctive Ring detect requires 'usecallerid' be on\n");
|
||||||
@@ -7778,6 +7782,27 @@ static void *pri_dchannel(void *vpri)
|
|||||||
snprintf(ani2str, 5, "%.2d", e->ring.ani2);
|
snprintf(ani2str, 5, "%.2d", e->ring.ani2);
|
||||||
pbx_builtin_setvar_helper(c, "ANI2", ani2str);
|
pbx_builtin_setvar_helper(c, "ANI2", ani2str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e->ring.redirectingreason >= 0) {
|
||||||
|
char redirstr[20] = "";
|
||||||
|
switch (e->ring.redirectingreason) {
|
||||||
|
case 0:
|
||||||
|
snprintf(redirstr, 20, "UNKNOWN");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
snprintf(redirstr, 20, "BUSY");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
snprintf(redirstr, 20, "NO_REPLY");
|
||||||
|
break;
|
||||||
|
case 0xF:
|
||||||
|
snprintf(redirstr, 20, "UNCONDITIONAL"); /* Other reason */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
pbx_builtin_setvar_helper(c, "PRIREDIRECTCAUSE", redirstr);
|
||||||
|
}
|
||||||
|
|
||||||
ast_mutex_lock(&pri->lock);
|
ast_mutex_lock(&pri->lock);
|
||||||
if (c && !ast_pthread_create(&threadid, &attr, ss_thread, c)) {
|
if (c && !ast_pthread_create(&threadid, &attr, ss_thread, c)) {
|
||||||
if (option_verbose > 2)
|
if (option_verbose > 2)
|
||||||
@@ -9778,6 +9803,8 @@ static int setup_zap(int reload)
|
|||||||
cur_rxflash = atoi(v->value);
|
cur_rxflash = atoi(v->value);
|
||||||
} else if (!strcasecmp(v->name, "debounce")) {
|
} else if (!strcasecmp(v->name, "debounce")) {
|
||||||
cur_debounce = atoi(v->value);
|
cur_debounce = atoi(v->value);
|
||||||
|
} else if (!strcasecmp(v->name, "emdigitwait")) {
|
||||||
|
cur_emdigitwait = atoi(v->value);
|
||||||
} else if (!strcasecmp(v->name, "polarityonanswerdelay")) {
|
} else if (!strcasecmp(v->name, "polarityonanswerdelay")) {
|
||||||
polarityonanswerdelay = atoi(v->value);
|
polarityonanswerdelay = atoi(v->value);
|
||||||
} else if (!strcasecmp(v->name, "hanguponpolarityswitch")) {
|
} else if (!strcasecmp(v->name, "hanguponpolarityswitch")) {
|
||||||
|
@@ -145,6 +145,8 @@ signalling=fxo_ls
|
|||||||
; rxwink: Receiver wink time (default 300ms)
|
; rxwink: Receiver wink time (default 300ms)
|
||||||
; rxflash: Receiver flashtime (default 1250ms)
|
; rxflash: Receiver flashtime (default 1250ms)
|
||||||
; debounce: Debounce timing (default 600ms)
|
; debounce: Debounce timing (default 600ms)
|
||||||
|
; emdigitwait: Time to wait for DID digits on E&M links (default 250ms) (Increase to 500
|
||||||
|
; or so if you are not getting all DID digits on your E&M link)
|
||||||
;
|
;
|
||||||
rxwink=300 ; Atlas seems to use long (250ms) winks
|
rxwink=300 ; Atlas seems to use long (250ms) winks
|
||||||
;
|
;
|
||||||
|
@@ -74,6 +74,7 @@ ${SIPUSERAGENT} SIP user agent
|
|||||||
${TIMESTAMP} Current date time in the format: YYYYMMDD-HHMMSS
|
${TIMESTAMP} Current date time in the format: YYYYMMDD-HHMMSS
|
||||||
${TXTCIDNAME} Result of application TXTCIDName
|
${TXTCIDNAME} Result of application TXTCIDName
|
||||||
${UNIQUEID} Current call unique identifier
|
${UNIQUEID} Current call unique identifier
|
||||||
|
${PRIREDIRECTREASON} Reason for redirect, if a call was directed
|
||||||
|
|
||||||
The dial() application sets the following variables:
|
The dial() application sets the following variables:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user