mirror of
https://github.com/asterisk/asterisk.git
synced 2025-12-12 18:12:33 +00:00
Fix DISA to actually have header it advertises (bug #197)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -118,7 +118,10 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
|||||||
int i,j,k,x;
|
int i,j,k,x;
|
||||||
struct localuser *u;
|
struct localuser *u;
|
||||||
char tmp[256],arg2[256],exten[AST_MAX_EXTENSION],acctcode[20];
|
char tmp[256],arg2[256],exten[AST_MAX_EXTENSION],acctcode[20];
|
||||||
unsigned char tone_block[640];
|
struct {
|
||||||
|
unsigned char offset[AST_FRIENDLY_OFFSET];
|
||||||
|
unsigned char buf[640];
|
||||||
|
} tone_block;
|
||||||
char *ourcontext,*ourcallerid;
|
char *ourcontext,*ourcallerid;
|
||||||
struct ast_frame *f,wf;
|
struct ast_frame *f,wf;
|
||||||
struct timeval lastout, now, lastdigittime;
|
struct timeval lastout, now, lastdigittime;
|
||||||
@@ -167,7 +170,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
|||||||
acctcode[0] = 0;
|
acctcode[0] = 0;
|
||||||
/* can we access DISA without password? */
|
/* can we access DISA without password? */
|
||||||
if (!strcasecmp(tmp, "no-password"))
|
if (!strcasecmp(tmp, "no-password"))
|
||||||
{
|
{;
|
||||||
k = 1;
|
k = 1;
|
||||||
ast_log(LOG_DEBUG, "DISA no-password login success\n");
|
ast_log(LOG_DEBUG, "DISA no-password login success\n");
|
||||||
}
|
}
|
||||||
@@ -207,9 +210,9 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
|||||||
wf.subclass = AST_FORMAT_ULAW;
|
wf.subclass = AST_FORMAT_ULAW;
|
||||||
wf.offset = AST_FRIENDLY_OFFSET;
|
wf.offset = AST_FRIENDLY_OFFSET;
|
||||||
wf.mallocd = 0;
|
wf.mallocd = 0;
|
||||||
wf.data = tone_block;
|
wf.data = tone_block.buf;
|
||||||
wf.datalen = f->datalen;
|
wf.datalen = f->datalen;
|
||||||
make_tone_block(tone_block, 350, 440, f->datalen, &x);
|
make_tone_block(tone_block.buf, 350, 440, f->datalen, &x);
|
||||||
wf.samples = wf.datalen;
|
wf.samples = wf.datalen;
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
if (ast_write(chan, &wf))
|
if (ast_write(chan, &wf))
|
||||||
@@ -340,13 +343,13 @@ reorder:
|
|||||||
wf.subclass = AST_FORMAT_ULAW;
|
wf.subclass = AST_FORMAT_ULAW;
|
||||||
wf.offset = AST_FRIENDLY_OFFSET;
|
wf.offset = AST_FRIENDLY_OFFSET;
|
||||||
wf.mallocd = 0;
|
wf.mallocd = 0;
|
||||||
wf.data = tone_block;
|
wf.data = tone_block.buf;
|
||||||
wf.datalen = f->datalen;
|
wf.datalen = f->datalen;
|
||||||
wf.samples = wf.datalen;
|
wf.samples = wf.datalen;
|
||||||
if (k)
|
if (k)
|
||||||
memset(tone_block, 0x7f, wf.datalen);
|
memset(tone_block.buf, 0x7f, wf.datalen);
|
||||||
else
|
else
|
||||||
make_tone_block(tone_block,480.0, 620.0,wf.datalen, &x);
|
make_tone_block(tone_block.buf,480.0, 620.0,wf.datalen, &x);
|
||||||
i += wf.datalen / 8;
|
i += wf.datalen / 8;
|
||||||
if (i > 250) {
|
if (i > 250) {
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user