Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Problem with Call record()

#108

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)

Reported by Roland Moriz · August 10th, 2010 @ 05:36 AM

State: resolved
Milestone: 0.8.5
Assigned to: Ben Klang Ben Klang

Activity

  1. Roland Moriz
    Roland Moriz

    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.

    August 10th, 2010 @ 05:43 AM

  2. Roland Moriz
  3. Ben Langfeld
    Ben Langfeld

    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.

    August 10th, 2010 @ 06:00 AM

  4. Roland Moriz
    Roland Moriz

    I think I've the problem/solution:

    It's the timeout!

    Record expects timeout in seconds
    RECORD FILE expects timeout in miliseconds

    So 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
    …
    

    August 10th, 2010 @ 06:17 AM

  5. Ben Klang
    Ben Klang
    • Milestone set to 0.8.5
    • Assigned user set to Ben Klang
    • Milestone order changed from 3028 to 0

    August 10th, 2010 @ 07:38 AM

  6. Roland Moriz
  7. Ben Klang
    Ben Klang
    • 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!

    August 10th, 2010 @ 11:32 AM

  8. Ben Klang
    Ben Klang
    • State changed from fixcommitted to resolved

    August 24th, 2010 @ 01:54 PM

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.