aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-30 19:03:07 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-30 19:03:07 +0000
commit57e9d9a550c49a0870bb93ea4bf8d0bdaf8fc2c9 (patch)
treef8411ff9ace1201c509e692768e4870fb0358590 /channels
parent22cb86722b88e807b176e2f7800b21841e115bd9 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@41432 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_features.c16
-rw-r--r--channels/chan_h323.c7
-rw-r--r--channels/chan_iax2.c2
-rw-r--r--channels/chan_local.c2
-rw-r--r--channels/chan_mgcp.c6
-rw-r--r--channels/chan_misdn.c4
-rw-r--r--channels/chan_phone.c4
-rw-r--r--channels/chan_sip.c7
-rw-r--r--channels/chan_skinny.c6
9 files changed, 21 insertions, 33 deletions
diff --git a/channels/chan_features.c b/channels/chan_features.c
index 38565ee41..5f680130b 100644
--- a/channels/chan_features.c
+++ b/channels/chan_features.c
@@ -328,14 +328,14 @@ static int features_call(struct ast_channel *ast, char *dest, int timeout)
ast_mutex_lock(&p->lock);
x = indexof(p, ast, 0);
if (!x && p->subchan) {
- ast_set_callerid(p->subchan,
- p->owner->cid.cid_num, p->owner->cid.cid_name,
- p->owner->cid.cid_ani ? p->owner->cid.cid_ani : p->owner->cid.cid_num);
-
- if (p->owner->cid.cid_rdnis)
- p->subchan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
- else
- p->subchan->cid.cid_rdnis = NULL;
+ p->subchan->cid.cid_name = p->owner->cid.cid_name ?
+ strdup(p->owner->cid.cid_name) : NULL;
+ p->subchan->cid.cid_num = p->owner->cid.cid_num ?
+ strdup(p->owner->cid.cid_num) : NULL;
+ p->subchan->cid.cid_ani = p->owner->cid.cid_ani ?
+ strdup(p->owner->cid.cid_ani) : NULL;
+ p->subchan->cid.cid_rdnis = p->owner->cid.cid_rdnis ?
+ strdup(p->owner->cid.cid_rdnis) : NULL;
p->subchan->cid.cid_pres = p->owner->cid.cid_pres;
strncpy(p->subchan->language, p->owner->language, sizeof(p->subchan->language) - 1);
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 814c546f9..b86d684c8 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -770,13 +770,10 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
ch->amaflags = pvt->amaflags;
}
- if (!ast_strlen_zero(pvt->cid_num)) {
+ 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)) {
+ 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);
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 61fc2ca36..f57853ae0 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3448,8 +3448,6 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
tmp->cid.cid_name = strdup(i->cid_name);
if (!ast_strlen_zero(i->ani))
tmp->cid.cid_ani = strdup(i->ani);
- else if (!ast_strlen_zero(i->cid_num))
- tmp->cid.cid_ani = strdup(i->cid_num);
tmp->cid.cid_pres = i->calling_pres;
tmp->cid.cid_ton = i->calling_ton;
tmp->cid.cid_tns = i->calling_tns;
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 069005902..a28964167 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -339,7 +339,7 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
ast_set_callerid(p->chan,
p->owner->cid.cid_num, p->owner->cid.cid_name,
- p->owner->cid.cid_ani ? p->chan->cid.cid_ani : p->owner->cid.cid_num);
+ p->owner->cid.cid_ani);
if (p->owner->cid.cid_rdnis)
p->chan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index cb3c3d7ce..14b187426 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -1429,10 +1429,8 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
strncpy(tmp->exten, i->exten, sizeof(tmp->exten)-1);
- if (!ast_strlen_zero(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);
@@ -2630,7 +2628,7 @@ static void *mgcp_ss(void *data)
ast_set_callerid(chan,
p->hidecallerid ? "" : p->cid_num,
p->hidecallerid ? "" : p->cid_name,
- chan->cid.cid_ani ? NULL : p->cid_num);
+ p->cid_num);
ast_setstate(chan, AST_STATE_RING);
/*zt_enable_ec(p);*/
if (p->dtmfmode & MGCP_DTMF_HYBRID) {
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 5b322f6bf..c6dc75920 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -2706,10 +2706,8 @@ static struct ast_channel *misdn_new(struct chan_list *chlist, int state, char
ast_callerid_parse(callerid, &cid_name, &cid_num);
- if (!ast_strlen_zero(cid_num)) {
+ if (!ast_strlen_zero(cid_num))
tmp->cid.cid_num = strdup(cid_num);
- tmp->cid.cid_ani = strdup(cid_num);
- }
if (!ast_strlen_zero(cid_name))
tmp->cid.cid_name = strdup(cid_name);
}
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 18fc8eaf8..65257d507 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -826,10 +826,8 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte
if (!ast_strlen_zero(i->language))
strncpy(tmp->language, i->language, sizeof(tmp->language)-1);
- if (!ast_strlen_zero(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);
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 37fd1746a..41948a160 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2331,6 +2331,7 @@ static int hangup_sip2cause(int cause)
switch(cause) {
case 603: /* Declined */
case 403: /* Not found */
+ case 487: /* Call cancelled */
return AST_CAUSE_CALL_REJECTED;
case 404: /* Not found */
return AST_CAUSE_UNALLOCATED;
@@ -2862,10 +2863,8 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
- if (!ast_strlen_zero(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 (!ast_strlen_zero(i->rdnis))
@@ -10172,6 +10171,8 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
break;
case 487:
/* channel now destroyed - dec the inUse counter */
+ if (owner)
+ ast_queue_hangup(p->owner);
update_call_counter(p, DEC_CALL_LIMIT);
break;
case 482: /* SIP is incapable of performing a hairpin call, which
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index e4ffe8165..1dc6c8c2a 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1746,7 +1746,7 @@ static void *skinny_ss(void *data)
ast_set_callerid(chan,
l->hidecallerid ? "" : l->cid_num,
l->hidecallerid ? "" : l->cid_name,
- chan->cid.cid_ani ? NULL : l->cid_num);
+ NULL);
ast_setstate(chan, AST_STATE_RING);
res = ast_pbx_run(chan);
if (res) {
@@ -2280,10 +2280,8 @@ static struct ast_channel *skinny_new(struct skinny_subchannel *sub, int state)
strncpy(tmp->context, l->context, sizeof(tmp->context)-1);
strncpy(tmp->exten,l->exten, sizeof(tmp->exten)-1);
- if (!ast_strlen_zero(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);