diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2001-12-07 22:57:34 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2001-12-07 22:57:34 +0000 |
commit | afbca6b478628803ab7a9768c8b7bf3c846e3b01 (patch) | |
tree | abb0e18c8355f757f2621516d64d71fbf88cb2f4 /apps/app_disa.c | |
parent | 3607024782adf8abf822c89bb2198d6157528b1e (diff) |
Version 0.1.10 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@390 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_disa.c')
-rwxr-xr-x | apps/app_disa.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/app_disa.c b/apps/app_disa.c index 1be7a062c..509dcbe49 100755 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -88,7 +88,7 @@ float val; { val = loudness * sin((f1 * 2.0 * M_PI * (*x))/8000.0); val += loudness * sin((f2 * 2.0 * M_PI * (*x)++)/8000.0); - data[i] = ast_lin2mu[(int)val + 32768]; + data[i] = AST_LIN2MU((int)val); } /* wrap back around from 8000 */ if (*x >= 8000) *x = 0; @@ -108,7 +108,7 @@ static int disa_exec(struct ast_channel *chan, void *data) { int i,j,k,x; struct localuser *u; - char tmp[256],exten[AST_MAX_EXTENSION]; + char tmp[256],exten[AST_MAX_EXTENSION],acctcode[20]; unsigned char tone_block[TONE_BLOCK_SIZE],sil_block[TONE_BLOCK_SIZE]; char *ourcontext; struct ast_frame *f,wf; @@ -134,7 +134,7 @@ static int disa_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "disa requires an argument (passcode/passcode file)\n"); return -1; } - strncpy(tmp, (char *)data, sizeof(tmp)); + strncpy(tmp, (char *)data, sizeof(tmp)-1); strtok(tmp, "|"); ourcontext = strtok(NULL, "|"); /* if context not specified, use "disa" */ @@ -255,10 +255,13 @@ static int disa_exec(struct ast_channel *chan, void *data) { ast_log(LOG_WARNING,"DISA on chan %s got bad password %s\n",chan->name,exten); goto reorder; + } /* password good, set to dial state */ k = 1; i = 0; /* re-set buffer pointer */ + exten[sizeof(acctcode)] = 0; + strcpy(acctcode,exten); exten[0] = 0; ast_log(LOG_DEBUG,"Successful DISA log-in on chan %s\n",chan->name); continue; @@ -272,7 +275,9 @@ static int disa_exec(struct ast_channel *chan, void *data) { strcpy(chan->exten,exten); strcpy(chan->context,ourcontext); + strcpy(chan->accountcode,acctcode); chan->priority = 0; + ast_cdr_init(chan->cdr,chan); LOCAL_USER_REMOVE(u); return 0; } |