mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 16:50:14 +00:00
another small set of simplifications
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -540,26 +540,25 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
|
|||||||
ast_clear_flag(o, DIAL_STILLGOING);
|
ast_clear_flag(o, DIAL_STILLGOING);
|
||||||
handle_cause(cause, &num);
|
handle_cause(cause, &num);
|
||||||
} else {
|
} else {
|
||||||
|
char *new_cid_num, *new_cid_name;
|
||||||
|
struct ast_channel *src;
|
||||||
|
|
||||||
ast_rtp_make_compatible(c, in, single);
|
ast_rtp_make_compatible(c, in, single);
|
||||||
if (c->cid.cid_num)
|
|
||||||
free(c->cid.cid_num);
|
|
||||||
c->cid.cid_num = NULL;
|
|
||||||
if (c->cid.cid_name)
|
|
||||||
free(c->cid.cid_name);
|
|
||||||
c->cid.cid_name = NULL;
|
|
||||||
|
|
||||||
if (ast_test_flag(o, OPT_FORCECLID)) {
|
if (ast_test_flag(o, OPT_FORCECLID)) {
|
||||||
c->cid.cid_num = ast_strdup(S_OR(in->macroexten, in->exten));
|
new_cid_num = ast_strdup(S_OR(in->macroexten, in->exten));
|
||||||
ast_string_field_set(c, accountcode, winner->accountcode);
|
new_cid_name = NULL; /* XXX no name ? */
|
||||||
c->cdrflags = winner->cdrflags;
|
src = winner;
|
||||||
} else {
|
} else {
|
||||||
c->cid.cid_num = ast_strdup(in->cid.cid_num);
|
new_cid_num = ast_strdup(in->cid.cid_num);
|
||||||
c->cid.cid_name = ast_strdup(in->cid.cid_name);
|
new_cid_name = ast_strdup(in->cid.cid_name);
|
||||||
ast_string_field_set(c, accountcode, in->accountcode);
|
src = in;
|
||||||
c->cdrflags = in->cdrflags;
|
|
||||||
}
|
}
|
||||||
|
ast_string_field_set(c, accountcode, src->accountcode);
|
||||||
|
c->cdrflags = src->cdrflags;
|
||||||
|
S_REPLACE(c->cid.cid_num, new_cid_num);
|
||||||
|
S_REPLACE(c->cid.cid_name, new_cid_name);
|
||||||
|
|
||||||
if (in->cid.cid_ani) {
|
if (in->cid.cid_ani) { /* XXX or maybe unconditional ? */
|
||||||
S_REPLACE(c->cid.cid_ani, ast_strdup(in->cid.cid_ani));
|
S_REPLACE(c->cid.cid_ani, ast_strdup(in->cid.cid_ani));
|
||||||
}
|
}
|
||||||
S_REPLACE(c->cid.cid_rdnis, ast_strdup(S_OR(in->macroexten, in->exten)));
|
S_REPLACE(c->cid.cid_rdnis, ast_strdup(S_OR(in->macroexten, in->exten)));
|
||||||
|
|||||||
Reference in New Issue
Block a user