[Home]

Summary:ASTERISK-01922: [patch] Adds 'noanswer' option to Read and Record applications
Reporter:Frank Mandarino (fmandarino)Labels:
Date Opened:2004-06-29 11:17:11Date Closed:2008-01-15 15:01:28.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) read_record_noanswer_skip.diff.txt
( 1) read_record_noanswer.diff.txt
Description:This patch adds a 'noanswer' option to the Read and Record applications, similar to the Playback application option, to avoid answering the line before reading digits or recording.  It allows information to be collected from the caller before the line is answered, which might be useful in certain situations.

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

The patch also cleans up some minor issues with the the Read and Record argument parsing, including:

app_read.c:
 - copies the arg data into a tmp buffer, then into the calloc()'d buffer using sprintf("%s").
 - doesn't free the calloc()'d buffer.

app_record.c:
 - tests loop index i against strlen(data) inside the for loop to see if the ":ext" extension is missing, however the for loop would exit before the test could be executed.
 - limits the extension length to 10 and the silencestr to 3, but does not skip to the next '|' delimiter if this limit is exceeded.
 - uses constants instead of sizeof() buffers.
 - performs strlen() calls in loop tests.
Comments:By: Mark Spencer (markster) 2004-06-29 14:43:35

Whoa there, partner, hold your horses.  If the line isn't answered, and you specify noanswer, we're still going to try to read digits?  Few providers will give you full duplex audio before you answer, and many if not most non-PRI interfaces of course don't support this concept either...  Maybe we should have it something like:

noanswer - don't answer if not answered yet
skip - skip if not answered yet

That would match the Playback app if i recall correctly.

By: Frank Mandarino (fmandarino) 2004-06-29 15:22:41

Maybe we are just lucky, but in our case we have two different PRI providers which provide 2 and 3 minutes of full-duplex audio before we have to answer.  
So yes, I *would* like to try to read digits when the line isn't answered, and in fact, I have tested it and it works.

I would be happy to add the skip option to match the Playback app.  I'll submit an updated patch, probably tomorrow.

By: cmslaght (cmslaght) 2004-06-29 22:55:04

In what situation would this be usefull?

By: Frank Mandarino (fmandarino) 2004-06-30 09:50:49

It might be useful for a pre-paid service to allow you to obtain some caller information to decide if service can be provided, and if not, avoid charging the caller by leaving the call unanswered.

By: Frank Mandarino (fmandarino) 2004-06-30 12:12:13

I have updated the patch to include the 'skip' option for both Read and Record, which skips the application when the line is not up.

I also added a 'maxduration' argument to Record, which limits the recording time to a maximum number of seconds, if the silence count is not reached and the user doesn't enter #.  I wanted to get this in before the 'option' argument was implemented, because I felt that the argument ordering was better with 'option' at the end.

By: Mark Spencer (markster) 2004-06-30 12:18:46

Do you already have a disclaimer on file?

By: Frank Mandarino (fmandarino) 2004-06-30 12:29:58

Yes, I do have a disclaimer on file.

By: Malcolm Davenport (mdavenport) 2004-07-01 09:41:45

Committed from the Huntsville Airport.

By: Digium Subversion (svnbot) 2008-01-15 15:01:28.000-0600

Repository: asterisk
Revision: 3363

U   trunk/apps/app_read.c
U   trunk/apps/app_record.c

------------------------------------------------------------------------
r3363 | markster | 2008-01-15 15:01:27 -0600 (Tue, 15 Jan 2008) | 2 lines

Read/Record updates (bug ASTERISK-1922)

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

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