freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

Can not record session. Media not enabled on channel

Open burne-muz opened this issue 4 years ago • 8 comments

When I receive an invite,I invoke a lua script by dialplan, it looks something like this:

session:execute("export", "nolocal:execute_on_media=record_session /home/admin/${uuid}.wav") session:execute("bridge", "sofia/gateway/next/666")

when i receiveed 183, i got an err channel sofia/gateway/next/666 entering state [proceeding][183] pre-answer sofia/gateway/next/666 execute [depth=1] sofia/gateway/next/666 record_session(/home/admin/****.wav) [ERR] switch_ivr_async.c:2982 Can not record session. Media not enabled on channel

I recently upgraded to version V1.10.7 and this issue did not occur on older versions so, if I want to record the call including early media, what should I do?

burne-muz avatar Nov 25 '21 10:11 burne-muz

If I comment out line 7511-7513 of src/mod/endpoints/mod_sofia/sofia.c,the execute_on_media=record_session will work //if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND && status < 200) { // switch_channel_mark_pre_answered(channel); //}

burne-muz avatar Dec 09 '21 03:12 burne-muz

i have same issue on version V1.10.8

eighty-zou avatar Nov 03 '22 09:11 eighty-zou

Hi, guys! We have the same isssue too.

https://github.com/signalwire/freeswitch/blob/v1.10/src/switch_ivr_async.c#L2951

konstantin-sancom avatar Feb 24 '23 10:02 konstantin-sancom

i have same issue. any solution?

wmspectre avatar Oct 24 '23 03:10 wmspectre

Can you share the log files?

greenbea avatar Oct 24 '23 05:10 greenbea

I was able to reproduce this issue. The problem is that switch_core_session_get_read_codec() returns NULL at https://github.com/signalwire/freeswitch/blob/v1.10.7/src/switch_ivr_async.c#L2951

greenbea avatar Oct 24 '23 22:10 greenbea

I got it to work by waiting a second before starting the recording to give time for the codec to get set on the channel.

originate {execute_on_media='sched_broadcast +1 record_session::/file.wav'}user/100

greenbea avatar Oct 25 '23 01:10 greenbea

我也遇到了同样的问题,请问最新版本修改好了吗?

suiyuemanbu avatar Sep 04 '24 00:09 suiyuemanbu