[Home]

Summary:ASTERISK-14600: main/file.c updated as part of addons merge to replace connected line information for each file playback
Reporter:dant (dant)Labels:
Date Opened:2009-08-05 04:07:00Date Closed:2009-08-05 16:43:45
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Revision 204413 of file.c was produced when addons were merged into trunk.

This revision introduced a few changes that were not mentioned in the change summary, that don't appear related to the change, were perhaps unintended and don't seem to produce intended results.

This version updates connected line name and number to be the name of the file currently being streamed overriding any other values already set.

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

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...

# 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;
}

------------------------------------------------------------------------
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.

------------------------------------------------------------------------
Comments:By: dant (dant) 2009-08-05 15:03:00

Note from russell on asterisk-dev:
<snip>
Oh goodness ... I can't believe I committed that!  It was certainly not intentional.  This was code I was just messing around with in my working copy.  It should be completely removed.
<snip>

He's reverted the change...

------------------------------------------------------------------------
r210522 | russell | 2009-08-05 22:09:24 +0800 (Wed, 05 Aug 2009) | 2 lines

Revert some silly code that snuck into trunk from my working copy.  Sorry!

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

Would someone kindly close this off?

Thanks...

By: Mark Michelson (mmichelson) 2009-08-05 16:43:45

Closing this since Russell has fixed his mistake. Thanks for reporting this!