mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Add support for handling INFORMATION messages carying more than one digit
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5615,7 +5615,13 @@ static void *pri_dchannel(void *vpri)
|
|||||||
}
|
}
|
||||||
/* Get called number */
|
/* Get called number */
|
||||||
else if (strlen(e->ring.callednum)) {
|
else if (strlen(e->ring.callednum)) {
|
||||||
|
#ifndef PRI_COPY_DIGITS_CALLED_NUMBER
|
||||||
|
#error Please update the libpri package
|
||||||
|
#endif
|
||||||
|
if (e->e==PRI_EVENT_RING)
|
||||||
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
|
||||||
|
strncat(pri->pvt[chan]->exten, e->ring.callednum, sizeof(pri->pvt[chan]->exten)-1);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
else
|
else
|
||||||
@@ -5626,13 +5632,21 @@ static void *pri_dchannel(void *vpri)
|
|||||||
/* queue DTMF frame if the PBX for this call was already started (we're forwarding INFORMATION further on */
|
/* queue DTMF frame if the PBX for this call was already started (we're forwarding INFORMATION further on */
|
||||||
if (pri->overlapdial && pri->pvt[chan]->call==e->ring.call && pri->pvt[chan]->owner) {
|
if (pri->overlapdial && pri->pvt[chan]->call==e->ring.call && pri->pvt[chan]->owner) {
|
||||||
/* how to do that */
|
/* how to do that */
|
||||||
char digit = e->ring.callednum[strlen(e->ring.callednum)-1];
|
int digitlen = strlen(e->ring.callednum);
|
||||||
struct ast_frame f = { AST_FRAME_DTMF, digit, };
|
char digit;
|
||||||
|
int i;
|
||||||
/* make sure that we store the right number in CDR */
|
/* make sure that we store the right number in CDR */
|
||||||
if (pri->pvt[chan]->owner->cdr)
|
if (pri->pvt[chan]->owner->cdr)
|
||||||
strncat(pri->pvt[chan]->owner->cdr->dst,&digit,1);
|
strncat(pri->pvt[chan]->owner->cdr->dst,e->ring.callednum,digitlen);
|
||||||
|
|
||||||
|
for (i=0; i<digitlen; i++) {
|
||||||
|
digit = e->ring.callednum[i];
|
||||||
|
{
|
||||||
|
struct ast_frame f = { AST_FRAME_DTMF, digit, };
|
||||||
ast_queue_frame(pri->pvt[chan]->owner, &f, 0);
|
ast_queue_frame(pri->pvt[chan]->owner, &f, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Make sure extension exists */
|
/* Make sure extension exists */
|
||||||
/* If extensions is empty then make sure we send later on SETUP_ACKNOWLEDGE to get digits in overlap mode */
|
/* If extensions is empty then make sure we send later on SETUP_ACKNOWLEDGE to get digits in overlap mode */
|
||||||
else if (strlen(pri->pvt[chan]->exten) && ast_exists_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) {
|
else if (strlen(pri->pvt[chan]->exten) && ast_exists_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) {
|
||||||
|
Reference in New Issue
Block a user