Problem with Call record()
Reported by Roland Moriz | August 10th, 2010 @ 05:36 AM | in 0.8.5
Hi,
in one of my components I do a record:
@recorded_file = @call.record :silence => 3, :maxduration => 120, :format => 'wav'
While this in some older 0.8.4 version works (besides not using wav format) it breaks in the latest github (adhearsion/adhearsion) master: no voice is recorded, it looks like it's just skipped/stopped by asterisk.
debug log old adhearsion release:
DEBUG agi: >>> EXEC Record "/tmp/recording_%d.gsm","3","120"
DEBUG agi: <<< 200 result=0
DEBUG agi: >>> GET VARIABLE RECORDED_FILE
DEBUG agi: <<< 200 result=1 (/tmp/recording_15)
debug log latest master:
DEBUG agi: >>> RECORD FILE "/tmp/recording_%d.gsm" "wav" "#" "120" "0" "BEEP" "s=3"
DEBUG agi: <<< 200 result=0 (timeout) endpos=1280
DEBUG agi: >>> GET VARIABLE "RECORDED_FILE"
DEBUG agi: <<< 200 result=0
(Asterisk 1.6.2.9 on OS X)
Comments and changes to this ticket
-
Roland Moriz August 10th, 2010 @ 05:43 AM
It was suggested to try without the format option:
@recorded_file = @call.record :silence => 3, :maxduration => 120
DEBUG agi: >>> RECORD FILE "/tmp/recording_%d" "gsm" "#" "120" "0" "BEEP" "s=3"
same problem.
-
Roland Moriz August 10th, 2010 @ 05:56 AM
The old version I used was http://github.com/jicksta/adhearsion
-
Ben Langfeld August 10th, 2010 @ 06:00 AM
One thing that stands out is the lack of comma delimiters between arguments (removed here: http://github.com/adhearsion/adhearsion/commit/0444c6955c20ffcea6d7... since response() does not introduce delimiters like execute() does). Roland believes whitespace param separation is ok for RECORD FILE. Previous version of this app was using Jay's repo.
-
Roland Moriz August 10th, 2010 @ 06:17 AM
I think I've the problem/solution:
It's the timeout!
Record expects timeout in seconds
RECORD FILE expects timeout in milisecondsSo it might be reasonable to change the adhearsion code:
… silence = options.delete(:silence) || 0 maxduration = options.delete(:maxduration) || -1 escapedigits = options.delete(:escapedigits) || "#" maxduration_milliseconds = maxduration * 1000 if (silence > 0) response("RECORD FILE", filename, format, escapedigits, maxduration_milliseconds, 0, "BEEP", "s=#{silence}") else response("RECORD FILE", filename, format, escapedigits, maxduration_milliseconds, 0, "BEEP") end …
-
Ben Klang August 10th, 2010 @ 07:38 AM
- Milestone set to 0.8.5
- Assigned user set to Ben Klang
- Milestone order changed from 3028 to 0
-
Ben Klang August 10th, 2010 @ 11:32 AM
- State changed from new to fixcommitted
- Tag changed from voip record to agi, record
I've merged your changes and made a tweak to how the maxduration is calculated. The changes have been pushed so I'm marking this "fixcommitted". Thanks!
-
Ben Klang August 24th, 2010 @ 01:54 PM
- State changed from fixcommitted to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป