[Home]

Summary:ASTERISK-13756: [patch] Dial application with the 'n' option not removing introductions
Reporter:Richard Miller (ulogic)Labels:
Date Opened:2009-03-16 10:35:03Date Closed:2009-11-02 12:17:28.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_dial
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_dial_v2.patch
( 1) app_dial.patch
( 2) app_dial-1.6.1.0.patch
( 3) bug14674.patch
Description:When using the 'p' screening option with the 'n' non-persistent option, the introductions are not supposed to be saved in the priv-callerintros directory.  However, the only time they are deleted in the current code is when the called party accepts the call by pressing the 1 key.

Caller A makes a call and dials the extension for called party P.  The call screening asks A to say the name to present to P.  P does not answer the call because P is on the phone, away from the desk, or sent the call to voice mail.  Later caller B make a call from the phone number.  Because announcement file still exists for that phone number, no prompt for the name is given, and the announcement given to P is the response from A.  P picks up the phone thinking that A has called and is surprised to find B on the line.

This behavior goes back to Asterisk version 1.2.

Also the help messages for the p and P options are not real clear.

Comments:By: Richard Miller (ulogic) 2009-03-16 12:28:27

If there was a previously existing file, and the caller hung up before the priv-recordintro prompt sound file started playing, a core dump would result.  Updated patch provided.

By: Richard Miller (ulogic) 2009-03-16 13:27:03

Unfortunately, I could not find a way to edit the description of the problem.  In the second paragraph, the third sentence should read.

Later, caller B makes a call from the SAME phone number.

By: Richard Miller (ulogic) 2009-05-09 19:16:20

New patch provided for Asterisk 1.6.1.0 because the old patch file failed with rejections due to too many code changes since the original submission.  It has been nearly two months since the original submission and the issue still has not been assigned to anyone!

By: Leif Madsen (lmadsen) 2009-05-22 13:46:14

Assigned this to dbrooks to review. Please test the behaviour prior and beyond the patch to make sure everything is kosher. Thanks!

By: David Brooks (dbrooks) 2009-05-26 16:14:31

Tested with 1.6.1 SVN. Issue prior to patch exists and operates as stated. Patch correctly fixes issue with call screening introductions.

By: Ronald Chan (loloski) 2009-05-30 02:54:29

on my limited testing at my pbx at home, the patch work as advertise.

By: David Vossel (dvossel) 2009-06-26 14:18:45

I've reviewed the patch and have some comments, shouldn't the intro file just be deleted at the end of the call if the 'n' option is used rather than using fstat to get the file's creation time to tell whether it is new or old?  Since this has been around for so long, is there any chance this could be a behavior change people won't necessarily want?

By: Richard Miller (ulogic) 2009-07-01 16:13:44

The patch I submitted is compartmentalized within the privacy handling section of app_dial.c and I was comfortable making that change.  It did take care of the primary symptom without breaking anything else.

I do agree that it would be better to delete the file at the end of the call.  One difficulty that I see is that the call could be transferred to another extension, either though a features.conf action or directly from the peer's phone.  In the latter case, the dialplan probably won't use the 'n' option for the Dial() application when placing an intra-extension call.  That means we have to save the OPT_SCREEN_NOINTRO flag somewhere in the channel object, and copy it to the new channel from the channel that is on hold when the transfer occurs.  We want to set the flag if the option is present, but only clear it if there was no previous peer.  This way we could actually play the intro to the target extension when the transfer is made.  The file would not be deleted until the initial caller disconnects.  I realize that the CDR time will get reset on the transferred call so the fstat test will cause the announcement file to be deleted in the current implementation.

I must admit that I am not familiar enough with the (sparsely commented) code and the flow of the call processing to attempt that change without further study and time commitment.

I have tested the direct phone transfer option with a Linksys SPA241, an AAstra 9112 and 480i CT, and a Snom 320 and 360.  The Snom phones pass the original caller ID on the transfer, but the other phones do not.  This is not really relevant but just an interesting note.

By: mbrevda (lazytt) 2009-07-07 23:55:18

A partial solution here would be to assign a unique id to the recorded file when using p (and then use a channel variable to identify the recording when transferring, etc). This would make it impossible to match the callerid on subsequent calls, even if the file wasn't deleted for some weird reason.

BTW, this issue is also relevant when calling form a blocked (anonymous) number.

By: Jeff Peeler (jpeeler) 2009-10-23 12:48:43

The patch I just added makes the behavior optional as we don't want to change behavior. I don't think any flags have to be copied anywhere as the dialstring arguments aren't tied to the channel. I can't think of any transfer scenarios that would lose the configured option, but if you find one let me know.

By: Digium Subversion (svnbot) 2009-11-02 12:13:29.000-0600

Repository: asterisk
Revision: 226889

U   branches/1.4/apps/app_dial.c

------------------------------------------------------------------------
r226889 | file | 2009-11-02 12:13:28 -0600 (Mon, 02 Nov 2009) | 11 lines

Fix a bug where the recorded privacy introduction file would not get removed if the caller hung up
while the called party had not yet answered.

This was fixed by introducing an argument to the 'n' option which, when enabled, removes the introduction
file under all scenarios. This was done to preserve the behavior that has existed for quite some time.

(closes issue ASTERISK-13756)
Reported by: ulogic
Patches:
     bug14674.patch uploaded by jpeeler (license 325)

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

http://svn.digium.com/view/asterisk?view=rev&revision=226889

By: Digium Subversion (svnbot) 2009-11-02 12:14:12.000-0600

Repository: asterisk
Revision: 226890

_U  trunk/
U   trunk/apps/app_dial.c

------------------------------------------------------------------------
r226890 | file | 2009-11-02 12:14:12 -0600 (Mon, 02 Nov 2009) | 18 lines

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

........
 r226889 | file | 2009-11-02 14:08:11 -0400 (Mon, 02 Nov 2009) | 11 lines
 
 Fix a bug where the recorded privacy introduction file would not get removed if the caller hung up
 while the called party had not yet answered.
 
 This was fixed by introducing an argument to the 'n' option which, when enabled, removes the introduction
 file under all scenarios. This was done to preserve the behavior that has existed for quite some time.
 
 (closes issue ASTERISK-13756)
 Reported by: ulogic
 Patches:
       bug14674.patch uploaded by jpeeler (license 325)
........

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

http://svn.digium.com/view/asterisk?view=rev&revision=226890

By: Digium Subversion (svnbot) 2009-11-02 12:14:56.000-0600

Repository: asterisk
Revision: 226891

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_dial.c

------------------------------------------------------------------------
r226891 | file | 2009-11-02 12:14:56 -0600 (Mon, 02 Nov 2009) | 25 lines

Merged revisions 226890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r226890 | file | 2009-11-02 14:08:54 -0400 (Mon, 02 Nov 2009) | 18 lines
 
 Merged revisions 226889 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r226889 | file | 2009-11-02 14:08:11 -0400 (Mon, 02 Nov 2009) | 11 lines
   
   Fix a bug where the recorded privacy introduction file would not get removed if the caller hung up
   while the called party had not yet answered.
   
   This was fixed by introducing an argument to the 'n' option which, when enabled, removes the introduction
   file under all scenarios. This was done to preserve the behavior that has existed for quite some time.
   
   (closes issue ASTERISK-13756)
   Reported by: ulogic
   Patches:
         bug14674.patch uploaded by jpeeler (license 325)
 ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=226891

By: Digium Subversion (svnbot) 2009-11-02 12:16:37.000-0600

Repository: asterisk
Revision: 226892

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_dial.c

------------------------------------------------------------------------
r226892 | file | 2009-11-02 12:16:37 -0600 (Mon, 02 Nov 2009) | 25 lines

Merged revisions 226890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r226890 | file | 2009-11-02 14:08:54 -0400 (Mon, 02 Nov 2009) | 18 lines
 
 Merged revisions 226889 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r226889 | file | 2009-11-02 14:08:11 -0400 (Mon, 02 Nov 2009) | 11 lines
   
   Fix a bug where the recorded privacy introduction file would not get removed if the caller hung up
   while the called party had not yet answered.
   
   This was fixed by introducing an argument to the 'n' option which, when enabled, removes the introduction
   file under all scenarios. This was done to preserve the behavior that has existed for quite some time.
   
   (closes issue ASTERISK-13756)
   Reported by: ulogic
   Patches:
         bug14674.patch uploaded by jpeeler (license 325)
 ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=226892

By: Digium Subversion (svnbot) 2009-11-02 12:17:26.000-0600

Repository: asterisk
Revision: 226893

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_dial.c

------------------------------------------------------------------------
r226893 | file | 2009-11-02 12:17:26 -0600 (Mon, 02 Nov 2009) | 25 lines

Merged revisions 226890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r226890 | file | 2009-11-02 14:08:54 -0400 (Mon, 02 Nov 2009) | 18 lines
 
 Merged revisions 226889 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r226889 | file | 2009-11-02 14:08:11 -0400 (Mon, 02 Nov 2009) | 11 lines
   
   Fix a bug where the recorded privacy introduction file would not get removed if the caller hung up
   while the called party had not yet answered.
   
   This was fixed by introducing an argument to the 'n' option which, when enabled, removes the introduction
   file under all scenarios. This was done to preserve the behavior that has existed for quite some time.
   
   (closes issue ASTERISK-13756)
   Reported by: ulogic
   Patches:
         bug14674.patch uploaded by jpeeler (license 325)
 ........
................

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

http://svn.digium.com/view/asterisk?view=rev&revision=226893