aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_skinny.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_skinny.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_skinny.c')
-rw-r--r--channels/chan_skinny.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index c35b02810..e4ffe8165 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -2279,7 +2279,14 @@ static struct ast_channel *skinny_new(struct skinny_subchannel *sub, int state)
strncpy(tmp->call_forward, l->call_forward, sizeof(tmp->call_forward) - 1);
strncpy(tmp->context, l->context, sizeof(tmp->context)-1);
strncpy(tmp->exten,l->exten, sizeof(tmp->exten)-1);
- ast_set_callerid(tmp, l->cid_num, l->cid_name, l->cid_num);
+
+ if (!ast_strlen_zero(l->cid_num)) {
+ tmp->cid.cid_num = strdup(l->cid_num);
+ tmp->cid.cid_ani = strdup(l->cid_num);
+ }
+ if (!ast_strlen_zero(l->cid_name))
+ tmp->cid.cid_name = strdup(l->cid_name);
+
tmp->priority = 1;
tmp->adsicpe = AST_ADSI_UNAVAILABLE;