signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.54k stars 1.41k forks source link

Can not record session. Media not enabled on channel #1460

Open burne-muz opened 2 years ago

burne-muz commented 2 years ago

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 commented 2 years ago

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); //}

eighty-zou commented 1 year ago

i have same issue on version V1.10.8

konstantin-sancom commented 1 year ago

Hi, guys! We have the same isssue too.

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

wmspectre commented 11 months ago

i have same issue. any solution?

greenbea commented 11 months ago

Can you share the log files?

greenbea commented 11 months ago

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 commented 11 months ago

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

suiyuemanbu commented 1 month ago

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