[asterisk-dev] trunk asterisk/main/file.c connected line updates intended?

D Tucny d at tucny.com
Wed Aug 5 04:07:18 CDT 2009


Hi folks,

I've just updated my trunk install and noticed some odd behaviour with
connected line updates... Every single file played sends connected line
updates...

e.g. for calls to voicemail, I set CONNECTEDLINE to VM (Eng) <*89>
previous behaviour was that it sent the RPID as an update and the phone
displayed VM (Eng) <*89> for the entire call
current behaviour is that the string is sent in the RPID as an update and
then every single sound file played triggers a further update, first sent as
an update and all subsequent ones as invites...
i.e. (from sip history)
11. ConnectedLine   Called party is now vm-password <vm-password>
12. TxReqRel        UPDATE / 102 UPDATE - UPDATE
15. ConnectedLine   Called party is now vm-youhave <vm-youhave>
16. TxReqRel        INVITE / 103 INVITE - INVITE
19. ConnectedLine   Calling party is now 1 <1>
20. TxReqRel        INVITE / 104 INVITE - INVITE
23. ConnectedLine   Calling party is now vm-Old <vm-Old>
24. TxReqRel        INVITE / 105 INVITE - INVITE
27. ConnectedLine   Calling party is now vm-message <vm-message>
28. TxReqRel        INVITE / 106 INVITE - INVITE
31. ConnectedLine   Calling party is now vm-onefor <vm-onefor>
32. TxReqRel        INVITE / 107 INVITE - INVITE
35. ConnectedLine   Calling party is now vm-Old <vm-Old>
36. TxReqRel        INVITE / 108 INVITE - INVITE
39. ConnectedLine   Calling party is now vm-messages <vm-messages>
40. TxReqRel        INVITE / 109 INVITE - INVITE
43. ConnectedLine   Calling party is now vm-opts <vm-opts>
44. TxReqRel        INVITE / 110 INVITE - INVITE
47. ConnectedLine   Calling party is now vm-helpexit <vm-helpexit>
48. TxReqRel        INVITE / 111 INVITE - INVITE

This doesn't seem to be intended behaviour...

The cause of these updates is a change to main/file.c that seems to have
sneaked in from somewhere...

# svn diff http://svn.digium.com/svn/asterisk/trunk/main/file.c@203802
http://svn.digium.com/svn/asterisk/trunk/main/file.c@204413
Index: file.c
===================================================================
--- file.c      (revision 203802)
+++ file.c      (revision 204413)
@@ -320,6 +320,7 @@
                free(f->filename);
        if (f->realfilename)
                free(f->realfilename);
+       ast_free(f->open_filename);
        if (f->fmt->close) {
                void (*closefn)(struct ast_filestream *) = f->fmt->close;
                closefn(f);
@@ -472,6 +473,7 @@
                                s->fmt = f;
                                s->trans = NULL;
                                s->filename = NULL;
+                               s->open_filename = ast_strdup(fn);;
                                if (s->fmt->format & AST_FORMAT_AUDIO_MASK)
{
                                        if (chan->stream)

ast_closestream(chan->stream);
@@ -826,7 +828,30 @@

 int ast_applystream(struct ast_channel *chan, struct ast_filestream *s)
 {
+       struct ast_party_connected_line connected;
+       char *fn;
+
+       ast_channel_lock(chan);
+       ast_party_connected_line_set_init(&connected, &chan->connected);
+       if (ast_strlen_zero(chan->connected.id.number)) {
+               connected.id.number = ast_strdupa(chan->exten);
+       }
+       ast_channel_unlock(chan);
+
+       fn = ast_strdupa(s->open_filename);
+       if ((fn = strrchr(fn, '/'))) {
+               char *dot;
+               *fn++ = '\0';
+               if ((dot = strrchr(fn, '.'))) {
+                       *dot = '\0';
+               }
+       }
+       connected.id.number = connected.id.name = fn;
+
+       ast_channel_update_connected_line(chan, &connected);
+
        s->owner = chan;
+
        return 0;
 }

This appears to have sneaked in with the addons merge...

------------------------------------------------------------------------
r204413 | russell | 2009-07-01 00:40:38 +0800 (Wed, 01 Jul 2009) | 12 lines
...
M /trunk/main/file.c
...
Move Asterisk-addons modules into the main Asterisk source tree.

Someone asked yesterday, "is there a good reason why we can't just put these
modules in Asterisk?".  After a brief discussion, as long as the modules are
clearly set aside in their own directory and not enabled by default, it is
perfectly fine.

For more information about why a module goes in addons, see
README-addons.txt.

chan_ooh323 does not currently compile as it is behind some trunk API
updates.
However, it will not build by default, so it should be okay for now.

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

Anyone know where this came from? Was it intended or was it perhaps a local
debug version that was accidentally included in a checkin?

Raised in the bug tracker as issue 15657...

Thanks,

d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20090805/3837710f/attachment.htm 


More information about the asterisk-dev mailing list