aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-28 18:10:19 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-28 18:10:19 +0000
commitc1dd08d50112fe12169fcfdd30893ab124f41dcd (patch)
tree199db703622272a3b6c7c5c281b4e1893dd62e58 /main
parent55cfaf4064cb8c70c0ad1ce86691b49a6c007e97 (diff)
Fixes an issue with the Newchannel AMI event during the Masquerading process.
Fixes an issue with the Newchannel AMI event during the Masquerading process, where no Newchannel AMI event was generated for the psuedo channel used during the masquerading process. (closes issue #17987) Reported by: RadicAlish Patches: newchannel.patch.txt uploaded by RadicAlish (license 1122) Tested by: RadicAlish Review: https://reviewboard.asterisk.org/r/937/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@289094 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main/channel.c b/main/channel.c
index 361286666..0e2919104 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -714,7 +714,7 @@ struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_
int flags;
struct varshead *headp;
va_list ap1, ap2;
- char *tech = "";
+ char *tech = "", *tech2 = NULL;
/* If shutting down, don't allocate any new channels */
if (shutting_down) {
@@ -815,7 +815,7 @@ alertpipe_failed:
tmp->cid.cid_num = ast_strdup(cid_num);
if (!ast_strlen_zero(name_fmt)) {
- char *slash;
+ char *slash, *slash2;
/* Almost every channel is calling this function, and setting the name via the ast_string_field_build() call.
* And they all use slightly different formats for their name string.
* This means, to set the name here, we have to accept variable args, and call the string_field_build from here.
@@ -830,6 +830,10 @@ alertpipe_failed:
va_end(ap2);
tech = ast_strdupa(tmp->name);
if ((slash = strchr(tech, '/'))) {
+ if ((slash2 = strchr(slash + 1, '/'))) {
+ tech2 = slash + 1;
+ *slash2 = '\0';
+ }
*slash = '\0';
}
}
@@ -886,7 +890,7 @@ alertpipe_failed:
* proper and correct place to make this call, but you sure do have to pass
* a lot of data into this func to do it here!
*/
- if (ast_get_channel_tech(tech)) {
+ if (ast_get_channel_tech(tech) || (tech2 && ast_get_channel_tech(tech2))) {
manager_event(EVENT_FLAG_CALL, "Newchannel",
"Channel: %s\r\n"
"State: %s\r\n"