diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-04-26 21:28:29 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-04-26 21:28:29 +0000 |
commit | 4d206fd40cbfce336981c9d5f8387c22e70ce665 (patch) | |
tree | 806ff138b4cd6beda923d68a6d0a277010963e45 | |
parent | f021960b9aa07b9e397a6e5620f6e1c7a69f7d9a (diff) |
Merged revisions 259023 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r259023 | mmichelson | 2010-04-26 16:13:35 -0500 (Mon, 26 Apr 2010) | 19 lines
Merged revisions 259018 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r259018 | mmichelson | 2010-04-26 16:03:08 -0500 (Mon, 26 Apr 2010) | 13 lines
Prevent Newchannel manager events for dummy channels.
No Newchannel manager event will be fired for channels that are
allocated to not match a registered technology type. Thus bogus
channels allocated solely for variable substitution or CDR
operations do not result in a Newchannel event.
(closes issue #16957)
Reported by: atis
Review: https://reviewboard.asterisk.org/r/601
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@259078 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/channel.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index c4d246b80..069d8b5e5 100644 --- a/main/channel.c +++ b/main/channel.c @@ -777,6 +777,7 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char int x; int flags; struct varshead *headp; + char *tech; /* If shutting down, don't allocate any new channels */ if (shutting_down) { @@ -881,6 +882,7 @@ alertpipe_failed: tmp->cid.cid_num = ast_strdup(cid_num); if (!ast_strlen_zero(name_fmt)) { + char *slash; /* 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. @@ -889,6 +891,10 @@ alertpipe_failed: * This new function was written so this can be accomplished. */ ast_string_field_build_va(tmp, name, name_fmt, ap1, ap2); + tech = ast_strdupa(tmp->name); + if ((slash = strchr(tech, '/'))) { + *slash = '\0'; + } } /* Reminder for the future: under what conditions do we NOT want to track cdrs on channels? */ @@ -943,7 +949,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_strlen_zero(name_fmt)) { + if (ast_get_channel_tech(tech)) { manager_event(EVENT_FLAG_CALL, "Newchannel", "Channel: %s\r\n" "ChannelState: %d\r\n" |