[Home]

Summary:ASTERISK-10109: callerid not passed to local channels
Reporter:paradise (paradise)Labels:
Date Opened:2007-08-17 11:57:26Date Closed:2007-08-17 16:20:32
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_local
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:it seems that after rev# 79174 changes.
caller id is not passed to chan_local.


****** ADDITIONAL INFORMATION ******

from the code it's clear that when creating new channel in chan_sip, chan_zap, ...
an ast_channel_alloc(..) is called with cid_num and cid_name values and all the properties including cid_num and cid_name is passed to new created channel, so  the bug fix(memory leak) in rev# 79174 in order to remove:
-       tmp->cid.cid_num = ast_strdup(i->cid_num);
-       tmp->cid.cid_name = ast_strdup(i->cid_name);
is right!

but in chan_local ast_channel_alloc(..) is called with cid_num=0 because local_pvt does not have cid_name and cid_num members!
tmp = ast_channel_alloc(1, state, 0, 0, t, p->exten, ...

so after the rev# 79174, local channels will have unknown callerid

putting back the strdup(..) to chan_local.c will solve the problem

Index: asterisk/channels/chan_local.c
===================================================================
--- asterisk/channels/chan_local.c      (revision 79886)
+++ asterisk/channels/chan_local.c      (working copy)
@@ -443,6 +443,9 @@

      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;
Comments:By: Jason Parker (jparker) 2007-08-17 12:03:38

I assume the proper fix here would be to modify the ast_channel_alloc line, to add the cid name/num, like all the other channel drivers

By: paradise (paradise) 2007-08-17 12:12:32

i have also tried to pass p->owner->cid.cid_num to ast_channel_alloc,
but it caused a crash

By: paradise (paradise) 2007-08-17 12:15:12

btw, i attached the patch file

By: paradise (paradise) 2007-08-17 12:17:18

oops! i have not signed license agreement

By: Jason Parker (jparker) 2007-08-17 12:18:45

No patch needed.  All it's doing is reverting that change in chan_local, right?

By: Digium Subversion (svnbot) 2007-08-17 12:27:10

Repository: asterisk
Revision: 79903

------------------------------------------------------------------------
r79903 | qwell | 2007-08-17 12:27:09 -0500 (Fri, 17 Aug 2007) | 13 lines

Merged revisions 79902 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue ASTERISK-10109)
........
r79902 | qwell | 2007-08-17 12:44:22 -0500 (Fri, 17 Aug 2007) | 4 lines

Re-add the setting of callerid name and number.

Issue 10485, reported by and fix explained by paradise.

........

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-08-17 16:20:32

Repository: asterisk
Revision: 79916

------------------------------------------------------------------------
r79916 | file | 2007-08-17 16:20:31 -0500 (Fri, 17 Aug 2007) | 164 lines

Merged revisions 79841,79858-79862,79885,79888,79894,79901,79903,79905,79907,79913,79915 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r79841 | crichter | 2007-08-17 05:29:56 -0300 (Fri, 17 Aug 2007) | 9 lines

Merged revisions 79833 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79833 | crichter | 2007-08-17 10:22:36 +0200 (Fr, 17 Aug 2007) | 1 line

sometimes we don't need to signal dtmf tones to asterisk, we just want them to go through as inband. Otherwise they might be generated by the other channel partner and then there is a double tone.
........

................
r79858 | russell | 2007-08-17 10:39:17 -0300 (Fri, 17 Aug 2007) | 13 lines

Merged revisions 79857 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79857 | russell | 2007-08-17 08:37:08 -0500 (Fri, 17 Aug 2007) | 5 lines

Fix some crashes in chan_sip.  This patch changes various places that add items
to the scheduler to ensure that they don't overwrite the ID of a previously
scheduled item.  If there is one, it should be removed.
(closes issue ASTERISK-10032, closes issue ASTERISK-9917, probably others, patch by me)

........

................
r79859 | tilghman | 2007-08-17 10:40:11 -0300 (Fri, 17 Aug 2007) | 2 lines

store and destroy implementations for realtime pgsql (closes issue ASTERISK-10015)

................
r79860 | tilghman | 2007-08-17 10:45:44 -0300 (Fri, 17 Aug 2007) | 2 lines

store and destroy implementations for sqlite (closes issue ASTERISK-10078) and odbc (closes issue ASTERISK-10079)

................
r79861 | russell | 2007-08-17 11:07:44 -0300 (Fri, 17 Aug 2007) | 12 lines

This commit adds a scheduler API call, ast_sched_replace that can be used
in place of a very common construct.  I also used it in a number of places
in chan_sip.

 if (id > -1)
    ast_sched_del(sched, id);
 id = ast_sched_add(sched, ...);

changes to:

 ast_sched_replace(id, sched, ...);

................
r79862 | russell | 2007-08-17 11:14:59 -0300 (Fri, 17 Aug 2007) | 2 lines

Make use of ast_sched_replace() in some places in chan_iax2

................
r79885 | tilghman | 2007-08-17 11:41:33 -0300 (Fri, 17 Aug 2007) | 2 lines

Change this flag... might not otherwise unlock in an OOM situation

................
r79888 | qwell | 2007-08-17 12:27:19 -0300 (Fri, 17 Aug 2007) | 4 lines

Correct the argument separator for a Dial statement in pbx_dundi.

Closes issue ASTERISK-10107, patch by lunn

................
r79894 | qwell | 2007-08-17 13:04:20 -0300 (Fri, 17 Aug 2007) | 4 lines

Fix Dial arguments in res_features.

Closes issue ASTERISK-10108, patch by lunn.

................
r79901 | tilghman | 2007-08-17 13:39:41 -0300 (Fri, 17 Aug 2007) | 2 lines

Documentation for '' in logger.conf, as suggested by jtodd (closes issue ASTERISK-10100)

................
r79903 | qwell | 2007-08-17 14:45:01 -0300 (Fri, 17 Aug 2007) | 13 lines

Merged revisions 79902 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue ASTERISK-10109)
........
r79902 | qwell | 2007-08-17 12:44:22 -0500 (Fri, 17 Aug 2007) | 4 lines

Re-add the setting of callerid name and number.

Issue 10485, reported by and fix explained by paradise.

........

................
r79905 | qwell | 2007-08-17 16:13:25 -0300 (Fri, 17 Aug 2007) | 20 lines

Merged revisions 79904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

(closes issue ASTERISK-10065)
........
r79904 | qwell | 2007-08-17 14:12:19 -0500 (Fri, 17 Aug 2007) | 11 lines

Don't send a semicolon over the wire in sip notify messages.
Caused by fix for issue 9938.

I basically took the code that existed before 9938 was fixed, and
copied it into a new function - ast_unescape_semicolon

There should be very few places this will be needed (pbx_config
does NOT need this (see issue 9938 for details))

Issue 10430, patch by me, with help/ideas from murf (thanks murf).

........

................
r79907 | mmichelson | 2007-08-17 16:16:51 -0300 (Fri, 17 Aug 2007) | 14 lines

Merged revisions 79906 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79906 | mmichelson | 2007-08-17 14:14:05 -0500 (Fri, 17 Aug 2007) | 6 lines

Patch allows for more seamless transition from file storage voicemail to ODBC storage voicemail.
If a retrieval of a greeting from the database fails, but the file is found on the file system, then
we go ahead an insert the greeting into the database. The result of this is that people who
switch from file storage to ODBC storage do not need to rerecord their voicemail greetings.


........

................
r79913 | russell | 2007-08-17 18:04:33 -0300 (Fri, 17 Aug 2007) | 12 lines

Merged revisions 79912 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79912 | russell | 2007-08-17 16:01:43 -0500 (Fri, 17 Aug 2007) | 4 lines

Avoid a crash in the handling of DTMF based Caller ID.  It is valid for
ast_read to return NULL in the case that the channel has been hung up.
(crash reported by anonymouz666 on IRC in #asterisk-dev)

........

................
r79915 | mmichelson | 2007-08-17 18:19:18 -0300 (Fri, 17 Aug 2007) | 3 lines

I broke the build. Now I'm fixing it.


................

------------------------------------------------------------------------