aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-05 05:26:29 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-05 05:26:29 +0000
commita0ab5e9b80c9c1ea7e41e5a82705ff72da5b072f (patch)
tree1df8cab3abb122ebca5fcfb28de5552ae33c8802 /channels/chan_mgcp.c
parent1bdd7371e035513f76f841bbe160b6acba4dab1d (diff)
Merged revisions 38903-38904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38903 | russell | 2006-08-05 01:07:39 -0400 (Sat, 05 Aug 2006) | 2 lines suppress a compiler warning about the usage of a potentially uninitialized variable ........ r38904 | russell | 2006-08-05 01:08:50 -0400 (Sat, 05 Aug 2006) | 10 lines Fix an issue that would cause a NewCallerID manager event to be generated before the channel's NewChannel event. This was due to a somewhat recent change that included using ast_set_callerid() where it wasn't before. This function should not be used in the channel driver "new" functions. (issue #7654, fixed by me) Also, fix a couple minor bugs in usecount handling. chan_iax2 could have increased the usecount but then returned an error. The place where chan_sip increased the usecount did not call ast_update_usecount() ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38905 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index b70e17154..7b56b8c98 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -1415,7 +1415,13 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
ast_string_field_set(tmp, call_forward, i->call_forward);
ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
- ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
+
+ /* Don't use ast_set_callerid() here because it will
+ * generate a NewCallerID event before the NewChannel event */
+ tmp->cid.cid_num = ast_strdup(i->cid_num);
+ tmp->cid.cid_ani = ast_strdup(i->cid_num);
+ tmp->cid.cid_name = ast_strdup(i->cid_name);
+
if (!i->adsi)
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
tmp->priority = 1;