mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
Merged revisions 202497 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r202497 | russell | 2009-06-22 15:11:04 -0500 (Mon, 22 Jun 2009) | 11 lines Merged revisions 202496 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r202496 | russell | 2009-06-22 15:08:53 -0500 (Mon, 22 Jun 2009) | 4 lines Report CallerID change during a masquerade. Reported by: markster ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@202498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4230,6 +4230,26 @@ static void clone_variables(struct ast_channel *original, struct ast_channel *cl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \pre chan is locked
|
||||||
|
*/
|
||||||
|
static void report_new_callerid(const struct ast_channel *chan)
|
||||||
|
{
|
||||||
|
manager_event(EVENT_FLAG_CALL, "NewCallerid",
|
||||||
|
"Channel: %s\r\n"
|
||||||
|
"CallerIDNum: %s\r\n"
|
||||||
|
"CallerIDName: %s\r\n"
|
||||||
|
"Uniqueid: %s\r\n"
|
||||||
|
"CID-CallingPres: %d (%s)\r\n",
|
||||||
|
chan->name,
|
||||||
|
S_OR(chan->cid.cid_num, ""),
|
||||||
|
S_OR(chan->cid.cid_name, ""),
|
||||||
|
chan->uniqueid,
|
||||||
|
chan->cid.cid_pres,
|
||||||
|
ast_describe_caller_presentation(chan->cid.cid_pres)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Masquerade a channel
|
\brief Masquerade a channel
|
||||||
|
|
||||||
@@ -4433,6 +4453,7 @@ int ast_do_masquerade(struct ast_channel *original)
|
|||||||
tmpcid = original->cid;
|
tmpcid = original->cid;
|
||||||
original->cid = clone->cid;
|
original->cid = clone->cid;
|
||||||
clone->cid = tmpcid;
|
clone->cid = tmpcid;
|
||||||
|
report_new_callerid(original);
|
||||||
|
|
||||||
/* Restore original timing file descriptor */
|
/* Restore original timing file descriptor */
|
||||||
ast_channel_set_fd(original, AST_TIMING_FD, original->timingfd);
|
ast_channel_set_fd(original, AST_TIMING_FD, original->timingfd);
|
||||||
@@ -4530,19 +4551,8 @@ void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char
|
|||||||
ast_free(chan->cid.cid_ani);
|
ast_free(chan->cid.cid_ani);
|
||||||
chan->cid.cid_ani = ast_strdup(cid_ani);
|
chan->cid.cid_ani = ast_strdup(cid_ani);
|
||||||
}
|
}
|
||||||
manager_event(EVENT_FLAG_CALL, "NewCallerid",
|
|
||||||
"Channel: %s\r\n"
|
report_new_callerid(chan);
|
||||||
"CallerIDNum: %s\r\n"
|
|
||||||
"CallerIDName: %s\r\n"
|
|
||||||
"Uniqueid: %s\r\n"
|
|
||||||
"CID-CallingPres: %d (%s)\r\n",
|
|
||||||
chan->name,
|
|
||||||
S_OR(chan->cid.cid_num, ""),
|
|
||||||
S_OR(chan->cid.cid_name, ""),
|
|
||||||
chan->uniqueid,
|
|
||||||
chan->cid.cid_pres,
|
|
||||||
ast_describe_caller_presentation(chan->cid.cid_pres)
|
|
||||||
);
|
|
||||||
|
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user