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: https://origsvn.digium.com/svn/asterisk/branches/1.2@38904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-08-05 05:08:50 +00:00
parent 5e3b7eec7d
commit 66b15a3461
10 changed files with 94 additions and 30 deletions

View File

@@ -1428,7 +1428,14 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
strncpy(tmp->call_forward, i->call_forward, sizeof(tmp->call_forward) - 1);
strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
strncpy(tmp->exten, i->exten, sizeof(tmp->exten)-1);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->cid_num)) {
tmp->cid.cid_num = strdup(i->cid_num);
tmp->cid.cid_ani = strdup(i->cid_num);
}
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
if (!i->adsi)
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
tmp->priority = 1;