diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-13 14:18:04 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-13 14:18:04 +0000 |
commit | 19462d7c765442837bb8ac70295d5a037fbf8adf (patch) | |
tree | 4c7413e4845bd4634d6a3b6d5a9f50c5c203291f | |
parent | 741c2964bea85f6a86960d9e53d674eb1a0ebabc (diff) |
(closes issue #10437)
Reported by: haklin
Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79174 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_gtalk.c | 2 | ||||
-rw-r--r-- | channels/chan_h323.c | 2 | ||||
-rw-r--r-- | channels/chan_iax2.c | 2 | ||||
-rw-r--r-- | channels/chan_local.c | 2 | ||||
-rw-r--r-- | channels/chan_mgcp.c | 2 | ||||
-rw-r--r-- | channels/chan_misdn.c | 8 | ||||
-rw-r--r-- | channels/chan_oss.c | 2 | ||||
-rw-r--r-- | channels/chan_phone.c | 2 | ||||
-rw-r--r-- | channels/chan_sip.c | 2 | ||||
-rw-r--r-- | channels/chan_skinny.c | 2 | ||||
-rw-r--r-- | channels/chan_zap.c | 4 |
11 files changed, 1 insertions, 29 deletions
diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c index 75b766a72..1e13521fd 100644 --- a/channels/chan_gtalk.c +++ b/channels/chan_gtalk.c @@ -973,9 +973,7 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i, cid = data; } cid = strsep(&cid, "@"); - tmp->cid.cid_num = ast_strdup(cid); tmp->cid.cid_ani = ast_strdup(cid); - tmp->cid.cid_name = ast_strdup(i->them); if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) tmp->cid.cid_dnid = ast_strdup(i->exten); tmp->priority = 1; diff --git a/channels/chan_h323.c b/channels/chan_h323.c index c13ede3c3..d519664ed 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -1069,9 +1069,7 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID event */ - ch->cid.cid_num = ast_strdup(cid_num); ch->cid.cid_ani = ast_strdup(cid_num); - ch->cid.cid_name = ast_strdup(cid_name); if (pvt->cd.redirect_reason >= 0) { ch->cid.cid_rdnis = ast_strdup(pvt->cd.redirect_number); diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 1c5cbf8ea..492a45782 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3368,8 +3368,6 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability) /* 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_name = ast_strdup(i->cid_name); if (!ast_strlen_zero(i->ani)) tmp->cid.cid_ani = ast_strdup(i->ani); else diff --git a/channels/chan_local.c b/channels/chan_local.c index 6b9ca55b6..4990d0fe1 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -443,8 +443,6 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout) ast_mutex_lock(&p->lock); - p->chan->cid.cid_num = ast_strdup(p->owner->cid.cid_num); - p->chan->cid.cid_name = ast_strdup(p->owner->cid.cid_name); p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis); p->chan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani); p->chan->cid.cid_pres = p->owner->cid.cid_pres; diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 50203a15e..bfcb3e8b4 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -1469,9 +1469,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state) /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID 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; diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index 0c6c25c9a..0c49a0bf4 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -3335,16 +3335,10 @@ static struct ast_channel *misdn_new(struct chan_list *chlist, int state, char else chan_misdn_log(1,0,"misdn_new: no exten given.\n"); - if (callerid) { - char *cid_name, *cid_num; - - ast_callerid_parse(callerid, &cid_name, &cid_num); + if (callerid) /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID event */ - tmp->cid.cid_num = ast_strdup(cid_num); tmp->cid.cid_ani = ast_strdup(cid_num); - tmp->cid.cid_name = ast_strdup(cid_name); - } { if (pipe(chlist->pipe)<0) diff --git a/channels/chan_oss.c b/channels/chan_oss.c index e136bb208..7b3c88751 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -1008,9 +1008,7 @@ static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx, ast_string_field_set(c, language, o->language); /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID event */ - c->cid.cid_num = ast_strdup(o->cid_num); c->cid.cid_ani = ast_strdup(o->cid_num); - c->cid.cid_name = ast_strdup(o->cid_name); if (!ast_strlen_zero(ext)) c->cid.cid_dnid = ast_strdup(ext); diff --git a/channels/chan_phone.c b/channels/chan_phone.c index ae2b8aba2..9ef4619a7 100644 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -867,9 +867,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte /* 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); i->owner = tmp; ast_module_ref(ast_module_info->self); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f216d1cc4..4eeea9fd8 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3992,9 +3992,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit /* Don't use ast_set_callerid() here because it will * generate an unnecessary NewCallerID 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 (!ast_strlen_zero(i->rdnis)) tmp->cid.cid_rdnis = ast_strdup(i->rdnis); diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 3bbc1bae2..60566c485 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -2863,9 +2863,7 @@ static struct ast_channel *skinny_new(struct skinny_line *l, int state) /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID event */ - tmp->cid.cid_num = ast_strdup(l->cid_num); tmp->cid.cid_ani = ast_strdup(l->cid_num); - tmp->cid.cid_name = ast_strdup(l->cid_name); tmp->priority = 1; tmp->adsicpe = AST_ADSI_UNAVAILABLE; diff --git a/channels/chan_zap.c b/channels/chan_zap.c index d6d16de6e..d20596dbd 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -5317,16 +5317,12 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID event */ #ifdef PRI_ANI - tmp->cid.cid_num = ast_strdup(i->cid_num); - tmp->cid.cid_name = ast_strdup(i->cid_name); if (!ast_strlen_zero(i->cid_ani)) tmp->cid.cid_ani = ast_strdup(i->cid_ani); else tmp->cid.cid_ani = ast_strdup(i->cid_num); #else - 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); #endif tmp->cid.cid_pres = i->callingpres; tmp->cid.cid_ton = i->cid_ton; |