[asterisk-commits] file: branch 1.4 r79174 - /branches/1.4/channels/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 13 09:18:05 CDT 2007
Author: file
Date: Mon Aug 13 09:18:04 2007
New Revision: 79174
URL: http://svn.digium.com/view/asterisk?view=rev&rev=79174
Log:
(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.
Modified:
branches/1.4/channels/chan_gtalk.c
branches/1.4/channels/chan_h323.c
branches/1.4/channels/chan_iax2.c
branches/1.4/channels/chan_local.c
branches/1.4/channels/chan_mgcp.c
branches/1.4/channels/chan_misdn.c
branches/1.4/channels/chan_oss.c
branches/1.4/channels/chan_phone.c
branches/1.4/channels/chan_sip.c
branches/1.4/channels/chan_skinny.c
branches/1.4/channels/chan_zap.c
Modified: branches/1.4/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_gtalk.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_gtalk.c (original)
+++ branches/1.4/channels/chan_gtalk.c Mon Aug 13 09:18:04 2007
@@ -973,9 +973,7 @@
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;
Modified: branches/1.4/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_h323.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_h323.c (original)
+++ branches/1.4/channels/chan_h323.c Mon Aug 13 09:18:04 2007
@@ -1069,9 +1069,7 @@
/* 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);
Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Mon Aug 13 09:18:04 2007
@@ -3368,8 +3368,6 @@
/* 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
Modified: branches/1.4/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_local.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_local.c (original)
+++ branches/1.4/channels/chan_local.c Mon Aug 13 09:18:04 2007
@@ -443,8 +443,6 @@
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;
Modified: branches/1.4/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_mgcp.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_mgcp.c (original)
+++ branches/1.4/channels/chan_mgcp.c Mon Aug 13 09:18:04 2007
@@ -1469,9 +1469,7 @@
/* 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;
Modified: branches/1.4/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_misdn.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_misdn.c (original)
+++ branches/1.4/channels/chan_misdn.c Mon Aug 13 09:18:04 2007
@@ -3335,16 +3335,10 @@
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)
Modified: branches/1.4/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_oss.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_oss.c (original)
+++ branches/1.4/channels/chan_oss.c Mon Aug 13 09:18:04 2007
@@ -1008,9 +1008,7 @@
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);
Modified: branches/1.4/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_phone.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_phone.c (original)
+++ branches/1.4/channels/chan_phone.c Mon Aug 13 09:18:04 2007
@@ -867,9 +867,7 @@
/* 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);
Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Mon Aug 13 09:18:04 2007
@@ -3992,9 +3992,7 @@
/* 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);
Modified: branches/1.4/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_skinny.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_skinny.c (original)
+++ branches/1.4/channels/chan_skinny.c Mon Aug 13 09:18:04 2007
@@ -2863,9 +2863,7 @@
/* 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;
Modified: branches/1.4/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_zap.c?view=diff&rev=79174&r1=79173&r2=79174
==============================================================================
--- branches/1.4/channels/chan_zap.c (original)
+++ branches/1.4/channels/chan_zap.c Mon Aug 13 09:18:04 2007
@@ -5317,16 +5317,12 @@
/* 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;
More information about the asterisk-commits
mailing list