aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_disa.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-09-01 15:44:27 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-09-01 15:44:27 +0000
commit9c33fb1e3e962d083059f177a4e2ec8226c1db58 (patch)
tree1dd48c6eb65c47478baeaf6248c70fe7d6dcabdb /apps/app_disa.c
parentd2f07e93ab8233c91d5e4a9b3b216126694aaaa2 (diff)
Fix DISA to actually have header it advertises (bug #197)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1453 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_disa.c')
-rwxr-xr-xapps/app_disa.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/app_disa.c b/apps/app_disa.c
index cb43a45e8..26676d4bb 100755
--- a/apps/app_disa.c
+++ b/apps/app_disa.c
@@ -118,7 +118,10 @@ static int disa_exec(struct ast_channel *chan, void *data)
int i,j,k,x;
struct localuser *u;
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;
struct ast_frame *f,wf;
struct timeval lastout, now, lastdigittime;
@@ -167,7 +170,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
acctcode[0] = 0;
/* can we access DISA without password? */
if (!strcasecmp(tmp, "no-password"))
- {
+ {;
k = 1;
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.offset = AST_FRIENDLY_OFFSET;
wf.mallocd = 0;
- wf.data = tone_block;
+ wf.data = tone_block.buf;
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;
ast_frfree(f);
if (ast_write(chan, &wf))
@@ -340,13 +343,13 @@ reorder:
wf.subclass = AST_FORMAT_ULAW;
wf.offset = AST_FRIENDLY_OFFSET;
wf.mallocd = 0;
- wf.data = tone_block;
+ wf.data = tone_block.buf;
wf.datalen = f->datalen;
wf.samples = wf.datalen;
if (k)
- memset(tone_block, 0x7f, wf.datalen);
+ memset(tone_block.buf, 0x7f, wf.datalen);
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;
if (i > 250) {
i = 0;