diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-04-19 14:14:40 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-04-19 14:14:40 +0000 |
commit | acf0f038dc4f6eaf2908e8837e72c1e734c01077 (patch) | |
tree | c4fdf0e8926932abe091bccab7d099bf2217d224 /apps/app_dial.c | |
parent | 3aaaa416098c624717645639ea22c419b8653e23 (diff) |
more simplifications
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index aae4caf7f..a0eb46b5f 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -334,24 +334,12 @@ static int onedigit_goto(struct ast_channel *chan, const char *context, char ext } -static char *get_cid_name(char *name, int namelen, struct ast_channel *chan) +static const char *get_cid_name(char *name, int namelen, struct ast_channel *chan) { - char *context; - char *exten; - if (!ast_strlen_zero(chan->macrocontext)) - context = chan->macrocontext; - else - context = chan->context; - - if (!ast_strlen_zero(chan->macroexten)) - exten = chan->macroexten; - else - exten = chan->exten; - - if (ast_get_hint(NULL, 0, name, namelen, chan, context, exten)) - return name; - else - return ""; + const char *context = S_OR(chan->macrocontext, chan->context); + const char *exten = S_OR(chan->macroexten, chan->exten); + + return ast_get_hint(NULL, 0, name, namelen, chan, context, exten) ? name : ""; } static void senddialevent(struct ast_channel *src, struct ast_channel *dst) @@ -424,7 +412,6 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l return NULL; } winner = ast_waitfor_n(watchers, pos, to); - o = outgoing; for (o = outgoing; o; o = o->next) { struct ast_frame *f; struct ast_channel *c = o->chan; |