[Home]

Summary:ASTERISK-09570: [patch] Using AGI command "say number 0 *" results in no audio output.
Reporter:Steven Haigh (crcinau)Labels:
Date Opened:2007-06-02 13:40:49Date Closed:2007-06-14 10:03:12
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) file.c.patch
Description:When trying to say the number zero (0) using AGI, no output is played.

Example code:
 #!/usr/bin/perl
 print "say number 0 *\n";
 exit 0

This can be worked around using the following code:
 #!/usr/bin/perl
 print "exec playback digits/0\n";
 exit 0

This is verified using Asterisk 1.4.4.
Comments:By: Eliel Sardanons (eliel) 2007-06-03 16:35:12

I notice the problem. Is only with the 0 (zero) digit that is beign handled different from the others, and the difference is that with all the digits it is being called ast_waitstream() and with 0 (zero) it is being called ast_waitstream_full().
This is because ctrlfd > -1 but audiofd == -1. ( and the condition to call ast_waitstream_full is that audiofd and ctrlfd must be > -1)
WARNING
I did this patch, but I think I'm breaking something else, so try it only to investigate this issue!

By: Eliel Sardanons (eliel) 2007-06-03 16:35:59

Disclaimer is on file.

By: Steven Haigh (crcinau) 2007-06-08 23:21:43

The patch applied to asterisk 1.4.4 ok.

# patch -p0 < file.c.patch
patching file main/file.c
Hunk #1 succeeded at 1100 (offset 7 lines).
#

This does seem to work and using the 'say number 0 *' command does now actually say "Zero" which is expected.

I haven't noticed anything else that has broken as yet.



By: Eliel Sardanons (eliel) 2007-06-09 11:48:21

I review my code and this will not break anything else.

By: Jason Parker (jparker) 2007-06-13 15:54:57

I'm not sure I understand why you're looking to fix it where you are.  On digit '0', it should eventually be getting into say_digit_str_full, which checks for ctrlfd and audiofd to be > -1, and if they aren't, it'll hit ast_waitstream.  If ctrlfd > -1 and audiofd == -1, then it wouldn't ever hit ast_waitstream_full anyways.

By: Eliel Sardanons (eliel) 2007-06-13 16:14:24

qwell, this is the problem, it is being called:
1) ast_say_number_full()     (Remember that the AGI was SAY NUMBER)
2) ast_say_number_full_en() <-- depends on the language.
3) ast_say_digits_full <-- It is not being called say_digit_str_full() as you say that handles ok the fds.

I arrive to this solution because is the simple one (the one with minor code changes that I found), but maybe is not the correct one. :-). The other solution would be to change: ast_say_number_full_XX and call say_digit_str_full() when (!num) instead of ast_say_digits_full().

By: Jason Parker (jparker) 2007-06-13 16:18:30

ast_say_digits_full calls ast_say_digit_str_full, which is "mapped" to say_digit_str_full in say.c

By: Eliel Sardanons (eliel) 2007-06-13 21:12:01

You are right, let me review my code, and find why I arrive to that solution.

By: Eliel Sardanons (eliel) 2007-06-14 08:54:53

hmmmm, file commit a patch for this:
http://svn.digium.com/view/asterisk/trunk/main/say.c?r1=68359&r2=68405
----------------------
r68397 | file | 2007-06-07 20:15:33 -0400 (Thu, 07 Jun 2007) | 2 lines

Don't call ast_waitstream_full when the control file descriptor and audio file descriptor are not set, simply call ast_waitstream! (issue ASTERISK-8294 reported by rickead2000)
-----------------------

And this I think, solve this issue.
Please try the latest revision.

By: Jason Parker (jparker) 2007-06-14 10:03:12

That explains a lot - thanks eliel for finding that.  That should definitely solve this bug, so I'm going to close it.  If you're still having troubles after upgrading to svn revision 68397 or great, please reopen this report.