Summary:ASTERISK-06883: Asterisk crashes when using record_file to record in h263 format
Reporter:Todd Courtnage (tcourtnage)Labels:
Date Opened:2006-05-02 10:29:59Date Closed:2006-05-24 12:03:27
Versions:Frequency of
Environment:Attachments:( 0) output.txt
Description:I have an agi that uses the record_file AGI command to record in h263 format:
As soon as the # is pressed (to stop recording), asterisk crashes.

The resulting testfile.h263 is empty (0 bytes), as would be expected.

This crash happens when trying to use either the Kapanga video softphone and Ekiga (aka GnomeMeeting).

Note I have confirmed Kapanga works with h263 and asterisk, as I have successfully created and played back a video voicemail using Kapanga and asterisk.

Reproduced the problem with current SVN trunk and also with asterisk

Attached is the gdb output as per the backtrace.txt document.


In the asterisk full log, I see this over and over:
May  2 09:25:07 WARNING[6054] translate.c: No translator path from unknown to unknown
May  2 09:25:07 WARNING[6054] file.c: Unable to translate to format h263, source format slin

I do have videosupport=yes and allow=263 in sip.conf.
Comments:By: Todd Courtnage (tcourtnage) 2006-05-02 10:46:02

I should point out that the actual command that the record_file method is executing is:
RECORD FILE testfile h263 # -1

By: Todd Courtnage (tcourtnage) 2006-05-02 11:10:10

I have done some more testing, bypassing the agi and called the Record command directly in the dialplan:
exten => 9987,1,Answer
exten => 9987,2,Wait(2)
exten => 9987,3,Record(/tmp/vid%d.h263|5|20)
exten => 9987,4,Hangup

Asterisk does not crash, but the Record command never returns, even when # is pressed, or the maxduration is reached.  No output file is created.

Out of curiosity, I also tried the Monitor command to monitor a call to voicemail:
exten => 9987,1,Answer
exten => 9987,2,Wait(2)
exten => 9987,3,Monitor(h263,/tmp/vid)
exten => 9987,4,VoiceMail(u400&default)
exten => 9987,5,Hangup

Everything goes as planned, caller can leave a voicemail, and an h263 voicemail is left in the appropriate INBOX.  However, the /tmp/vid-in.h263 and /tmp/vid-out.h263 files are empty (file size 0).

By: Olle Johansson (oej) 2006-05-02 15:03:42

I've seen the same thing.

By: Serge Vecher (serge-v) 2006-05-10 11:22:47

is this only an issue with h.263 format. Does Kappanga phone support h.264, which is in trunk?

By: Todd Courtnage (tcourtnage) 2006-05-10 12:54:18

Kapanga does not support h.264, only h.263.  However, I can say that it is also an issue with h.261, as that is the only video codec Ekiga (GnomeMeeting) supports, and I also see the crash with Ekiga.

By: Mark Spencer (markster) 2006-05-11 03:01:04

You should not explicitly attempt to record in a video format.  It will automatically select and record to that video format as required.  Use record(foo.wav) for example and post an updated output.  I'll try to figure out why it's crashing per-se.

By: Mark Spencer (markster) 2006-05-11 03:03:22

Does this occur when using the "Record" application as well or only when using AGI?

By: Todd Courtnage (tcourtnage) 2006-05-11 10:56:45

Hi Markster.

I did some more testing.  As per your suggestions, I didn't specify h263, just wav, in the record command:
exten => 9987,1,Answer
exten => 9987,2,Wait(2)
exten => 9987,3,Record(/tmp/vid%d.wav|5|20)
exten => 9987,4,Hangup

And it worked tremendously!  It recorded both a .h263 file and a .wav file just fine.  Thanks for that!

I then changed the record_file method I'm using in the AGI, specifying wav instead of h263.  The actual command that was sent to asterisk was:
RECORD FILE "/tmp/test" wav "#" -1 BEEP s=15

Asterisk did not crash, but it did not create a .h263 video file, only a .wav file.

So, to sum up:
- using the Record command directly in the dialplan works perfectly, making sure to specify the format as wav, not .h263.  Asterisk was smart enough to realize there was a video stream as well, and created both a video file (.h263) and a wav file.
- using the AGI to send a record command to asterisk (specifying wav as the format) causes asterisk to record a wav file, and that's it, no video file.

And, as I mentioned in my original bug report, using the AGI to send a record command to asterisk (specifying h263 as the format) results in asterisk crashing.


By: Kevin P. Fleming (kpfleming) 2006-05-24 12:03:26

The AGI 'RECORD FILE' handler made no attempt to handle video frames at all. This has been corrected in branch-1.2 revision 29973 and trunk revision 29988.