Add limited overlap sending for PRI, eg: exten => 9,1,Dial,Zap/g1/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
Martin Pycko 22 years ago
parent 54d3735b7b
commit 697c33c81d

@ -671,9 +671,11 @@ static int zt_digit(struct ast_channel *ast, char digit)
int res = 0; int res = 0;
int index; int index;
p = ast->pvt->pvt; p = ast->pvt->pvt;
index = zt_get_index(ast, p, 0); index = zt_get_index(ast, p, 0);
if (index == SUB_REAL) { if (index == SUB_REAL) {
if (p->sig == SIG_PRI && ast->_state == AST_STATE_DIALING) {
pri_information(p->pri->pri,p->call,digit);
} else {
zo.op = ZT_DIAL_OP_APPEND; zo.op = ZT_DIAL_OP_APPEND;
zo.dialstr[0] = 'T'; zo.dialstr[0] = 'T';
zo.dialstr[1] = digit; zo.dialstr[1] = digit;
@ -683,6 +685,7 @@ static int zt_digit(struct ast_channel *ast, char digit)
else else
p->dialing = 1; p->dialing = 1;
} }
}
return res; return res;
} }
@ -5473,6 +5476,7 @@ static void *pri_dchannel(void *vpri)
case PRI_EVENT_INFO_RECEIVED: case PRI_EVENT_INFO_RECEIVED:
case PRI_EVENT_RING: case PRI_EVENT_RING:
chan = e->ring.channel; chan = e->ring.channel;
if (e->e==PRI_EVENT_RING) {
if ((chan < 1) || (chan > pri->channels)) { if ((chan < 1) || (chan > pri->channels)) {
ast_log(LOG_WARNING, "Ring requested on odd channel number %d span %d\n", chan, pri->span); ast_log(LOG_WARNING, "Ring requested on odd channel number %d span %d\n", chan, pri->span);
chan = 0; chan = 0;
@ -5491,6 +5495,7 @@ static void *pri_dchannel(void *vpri)
} }
if (!chan && (e->ring.flexible)) if (!chan && (e->ring.flexible))
chan = pri_find_empty_chan(pri); chan = pri_find_empty_chan(pri);
}
if (chan) { if (chan) {
if (e->e==PRI_EVENT_RING) { if (e->e==PRI_EVENT_RING) {
/* Get caller ID */ /* Get caller ID */
@ -5506,10 +5511,15 @@ static void *pri_dchannel(void *vpri)
/* Get called number */ /* Get called number */
if (strlen(e->ring.callednum)) { if (strlen(e->ring.callednum)) {
strncpy(pri->pvt[chan]->exten, e->ring.callednum, sizeof(pri->pvt[chan]->exten)-1); strncpy(pri->pvt[chan]->exten, e->ring.callednum, sizeof(pri->pvt[chan]->exten)-1);
} else }
#if 0
else
strcpy(pri->pvt[chan]->exten, "s"); strcpy(pri->pvt[chan]->exten, "s");
#endif
else
strcpy(pri->pvt[chan]->exten, "");
/* Make sure extension exists */ /* Make sure extension exists */
if (ast_exists_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) { if (strlen(pri->pvt[chan]->exten) && ast_exists_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) {
/* Setup law */ /* Setup law */
int law; int law;
if (e->ring.layer1 == PRI_LAYER_1_ALAW) if (e->ring.layer1 == PRI_LAYER_1_ALAW)
@ -5537,7 +5547,7 @@ static void *pri_dchannel(void *vpri)
pri->pvt[chan]->call = 0; pri->pvt[chan]->call = 0;
} }
} else { } else {
if (ast_matchmore_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) if (!strlen(pri->pvt[chan]->exten) || ast_matchmore_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid))
{ {
if (e->e==PRI_EVENT_RING) pri_need_more_info(pri->pri, e->ring.call, chan, 1); if (e->e==PRI_EVENT_RING) pri_need_more_info(pri->pri, e->ring.call, chan, 1);
} else { } else {

Loading…
Cancel
Save