aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_h323.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-05 05:08:50 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-05 05:08:50 +0000
commitf05aa97fe5ee633cffc5641a9395f0c06ca27de5 (patch)
treeae71fb6b76d48d499d0f8c8db72cfb68cc837b7f /channels/chan_h323.c
parent85d8708df8c31feb766348a0772cc0c652765aa5 (diff)
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/branches/1.2@38904 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rw-r--r--channels/chan_h323.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index d9057a16c..814c546f9 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -770,15 +770,15 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
ch->amaflags = pvt->amaflags;
}
- /*
- * If cid_num and cdi.call_source_e164 are both null, then
- * ast_set_callerid will do the right thing and leave the
- * cid_num and cid_ani for the channel alone.
- */
- ast_set_callerid(ch,
- !ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164,
- pvt->cid_name,
- !ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164);
+ if (!ast_strlen_zero(pvt->cid_num)) {
+ ch->cid.cid_num = strdup(pvt->cid_num);
+ ch->cid.cid_ani = strdup(pvt->cid_num);
+ } else if (!ast_strlen_zero(pvt->cd.call_source_e164)) {
+ ch->cid.cid_num = strdup(pvt->cd.call_source_e164);
+ ch->cid.cid_ani = strdup(pvt->cd.call_source_e164);
+ }
+ if (!ast_strlen_zero(pvt->cid_name))
+ ch->cid.cid_name = strdup(pvt->cid_name);
if (!ast_strlen_zero(pvt->rdnis)) {
ch->cid.cid_rdnis = strdup(pvt->rdnis);