Read() always fails immediately

I am trying to read in a 10 digit number, however the read() command always causes the call to be immediately disconnected. I was not passing in an audio file to play, as it seemed optional from the docs. When looking in the logs, I see in error in file.c about not being able to load the file in ulaw format or any format at all. To try and appease the function I passed in a standard sound such as ‘beep’ or ‘your’ and I receive the same error, file.c - beep cannot be found. However, when placing Playback(beep) on the proceeding line of the dialplan, it will play the sound fine, and then exit with the same read error. My syntax was

Read(toNum, , 10) also tried with | instead of ,
and
Read(toNum, beep, 10)
My sounds are in the default directory. I can post specific dial plan and log text when I get home, but anyone have an idea why Read wouldn’t work? Thanks.

[quote][Feb 21 07:01:05] VERBOSE[16514] logger.c: – Executing [s@from-pstn:1] Set(“SIP/67.55.159.156-08834cd8”, “__FROM_DID=s”) in new stack
[Feb 21 07:01:05] VERBOSE[16514] logger.c: – Executing [s@from-pstn:2] GotoIf(“SIP/67.55.159.156-08834cd8”, “1 ?cidok”) in new stack
[Feb 21 07:01:05] VERBOSE[16514] logger.c: – Goto (from-pstn,s,4)
[Feb 21 07:01:05] VERBOSE[16514] logger.c: – Executing [s@from-pstn:4] NoOp(“SIP/67.55.159.156-08834cd8”, “CallerID is “2032401675” <2032401675>”) in new stack
[Feb 21 07:01:05] VERBOSE[16514] logger.c: – Executing [s@from-pstn:5] Goto(“SIP/67.55.159.156-08834cd8”, “custom-count2four|s|1”) in new stack
[Feb 21 07:01:05] VERBOSE[16514] logger.c: – Goto (custom-count2four,s,1)
[Feb 21 07:01:05] VERBOSE[16514] logger.c: – Executing [s@custom-count2four:1] Answer(“SIP/67.55.159.156-08834cd8”, “2500”) in new stack
[Feb 21 07:01:08] VERBOSE[16514] logger.c: – Executing [s@custom-count2four:2] Flite(“SIP/67.55.159.156-08834cd8”, “Please enter the number you wish to call”) in new stack
[Feb 21 07:01:08] VERBOSE[16514] logger.c: == Parsing ‘/etc/asterisk/flite.conf’: [Feb 21 07:01:08] VERBOSE[16514] logger.c: Found
[Feb 21 07:01:08] DEBUG[16514] app_flite.c: Text passed to Flite: Please enter the number you wish to call
[Feb 21 07:01:08] VERBOSE[16514] logger.c: – Playing ‘/tmp/flite_buf_Z4ShJd’ (language ‘en’)
[Feb 21 07:01:11] VERBOSE[16514] logger.c: – Executing [s@custom-count2four:3] Read(“SIP/67.55.159.156-08834cd8”, “toNum| your| 10”) in new stack
[Feb 21 07:01:11] VERBOSE[16514] logger.c: – Accepting a maximum of 10 digits.
[Feb 21 07:01:11] WARNING[16514] file.c: File your does not exist in any format
[Feb 21 07:01:11] WARNING[16514] file.c: Unable to open your (format 0x4 (ulaw)): No such file or directory
[Feb 21 07:01:11] VERBOSE[16514] logger.c: – User disconnected

[Feb 21 07:01:11] VERBOSE[16514] logger.c: == Spawn extension (custom-count2four, s, 3) exited non-zero on ‘SIP/67.55.159.156-08834cd8’[/quote]

Read(toNum) works, but as soon as I pass any more parameters it hangs up, even though it says --Accepting a maximum of 10 digits.

Why is it looking for a file, and why cant it find any of them?
[Feb 21 12:12:47] WARNING[17222] file.c: File does not exist in any format
[Feb 21 12:12:47] WARNING[17222] file.c: Unable to open (format 0x4 (ulaw)): No such file or directory

Any help is greatly appreciated.

No one has any ideas? Am I doing something obviously wrong?

Read(toNum) should accept any number for input while “#” hasnt been entered.
If you are still getting “Accepting 10 digits”, did you remember to do a “dialplan reload” at *CLI> ?

Try this:

miles_cuc: I want to read in 10 digits, that is not the problem. The problem is that passing any parameters besides the variable name causes a failure.

davevg: Thanks for the help, however it did not work. Same error:

[quote]Read(“SIP/67.55.159.156-09abce50”, “toNum| |10| i”) in new stack
[Feb 23 16:44:16] VERBOSE[9383] logger.c: – Accepting a maximum of 10 digits.
[Feb 23 16:44:16] WARNING[9383] file.c: File does not exist in any format
[Feb 23 16:44:16] WARNING[9383] file.c: Unable to open (format 0x4 (ulaw)): No such file or directory
[Feb 23 16:44:16] VERBOSE[9383] logger.c: – User disconnected[/quote]

perhaps I can specify the sound directory in asterisk.conf even tho its the default? Do you know the parameter I would add to the [directories] section? It seems like something is broken tho, since Playback works and Read shouldn’t need a sound.

Are you putting a space in the empty parameters? The pipe’s should be right next to each other without a space between them.

well it was the spaces. Now I know better. Thank you very much.

Oh and what does ‘i’ mean in the options parameter? I see skip and answer as the options. Also where is the most up to date documentation? This is the best Ive found : asteriskguru.com/tutorials/read.html

To see what an application does and its parameters from the CLI type
"core show application <>"