Code cleanup

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.0
James Golovich 22 years ago
parent 66b96f417c
commit 46b24e8a27

@ -260,7 +260,8 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
return 0;
}
int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digits,int between) {
int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digits,int between)
{
char *ptr=NULL;
int res=0;
struct ast_frame f;
@ -286,8 +287,7 @@ int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digi
f.src = "ast_dtmf_stream";
if (strchr("0123456789*#abcdABCD",*ptr)==NULL) {
ast_log(LOG_WARNING, "Illegal DTMF character '%c' in string. (0-9*#aAbBcCdD allowed)\n",*ptr);
}
else {
} else {
res = ast_write(chan, &f);
if (res)
break;
@ -301,6 +301,5 @@ int ast_dtmf_stream(struct ast_channel *chan,struct ast_channel *peer,char *digi
if (peer)
res = ast_autoservice_stop(peer);
}
return res;
}

@ -25,6 +25,7 @@
#include <asterisk/musiconhold.h>
#include <asterisk/callerid.h>
#include <asterisk/utils.h>
#include <asterisk/app.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
@ -477,10 +478,9 @@ static int dial_exec(struct ast_channel *chan, void *data)
sdtmfptr = strchr(sdtmfdata, ')');
if (sdtmfptr)
*sdtmfptr = '\0';
else {
else
ast_log(LOG_WARNING, "D( Data lacking trailing ')'\n");
}
}
/* XXX LIMIT SUPPORT */
if ((limitptr = strstr(transfer, "L("))) {
@ -494,9 +494,8 @@ static int dial_exec(struct ast_channel *chan, void *data)
limitptr = strchr(limitdata, ')');
if (limitptr)
*limitptr = '\0';
else {
else
ast_log(LOG_WARNING, "Limit Data lacking trailing ')'\n");
}
var = pbx_builtin_getvar_helper(chan,"LIMIT_PLAYAUDIO_CALLER");
play_to_caller = var ? ast_true(var) : 1;
@ -544,8 +543,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
if (!play_warning && !start_sound && !end_sound && timelimit) {
calldurationlimit=timelimit/1000;
timelimit=play_to_caller=play_to_callee=play_warning=warning_freq=0;
}
else if (option_verbose > 2) {
} else if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3"Limit Data:\n");
ast_verbose(VERBOSE_PREFIX_3"timelimit=%ld\n",timelimit);
ast_verbose(VERBOSE_PREFIX_3"play_warning=%ld\n",play_warning);
@ -556,7 +554,6 @@ static int dial_exec(struct ast_channel *chan, void *data)
ast_verbose(VERBOSE_PREFIX_3"warning_sound=%s\n",warning_sound ? warning_sound : "UNDEF");
ast_verbose(VERBOSE_PREFIX_3"end_sound=%s\n",end_sound ? end_sound : "UNDEF");
}
}
/* XXX ANNOUNCE SUPPORT */
@ -845,8 +842,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
// Ok, done. stop autoservice
res = ast_autoservice_stop(chan);
}
else
} else
res = 0;
if (!res) {
@ -854,8 +850,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
time(&now);
chan->whentohangup = now + calldurationlimit;
}
if(strlen(sdtmfdata))
if (!ast_strlen_zero(sdtmfdata))
res = ast_dtmf_stream(peer,chan,sdtmfdata,0);
}
@ -873,8 +868,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
config.end_sound = end_sound;
config.start_sound = start_sound;
res = ast_bridge_call(chan,peer,&config);
}
else
} else
res = -1;
if (res != AST_PBX_NO_HANGUP_PEER)

@ -48,7 +48,7 @@ extern int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
//! Safely spawn an external program while closingn file descriptors
extern int ast_safe_system(const char *s);
// send DTMF to chan (optionally entertain peer)
//! Send DTMF to chan (optionally entertain peer)
int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, char *digits, int between);
#if defined(__cplusplus) || defined(c_plusplus)

Loading…
Cancel
Save