amigniter / mod_audio_stream

FreeSWITCH module to stream audio to websocket and receive response
MIT License
66 stars 31 forks source link

Sometime i get wrong meta data. Need help #53

Open SumyabazarBaatar opened 3 weeks ago

SumyabazarBaatar commented 3 weeks ago

Hello. I need some help for get correct metadata that i send from freeswitch to my application. Here is example of im getting wrong metadata.

2024-08-21 15:09:36.354244 96.53% [DEBUG] mod_audio_stream.c:150 mod_audio_stream cmd: f3a35eb3-20dc-4622-b116-074976147811 start ws://<ADDRESS>:8000/pub/audiostream mono 16k {"field1":15,"field2":"beast","field3":"1234"}
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.354244 96.53% [DEBUG] mod_audio_stream.c:81 calling stream_session_init.
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.354244 96.53% [DEBUG] audio_streamer_glue.cpp:368 (f3a35eb3-20dc-4622-b116-074976147811) resampling from 8000 to 16000
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.354244 96.53% [DEBUG] audio_streamer_glue.cpp:379 (f3a35eb3-20dc-4622-b116-074976147811) stream_data_init
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.354244 96.53% [DEBUG] mod_audio_stream.c:87 adding bug.
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.354244 96.53% [DEBUG] switch_core_media_bug.c:976 Attaching BUG to sofia/internal/1000@<FREESWITCHSERVERADDRESS>
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.354244 96.53% [DEBUG] mod_audio_stream.c:91 setting bug private data.
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.354244 96.53% [DEBUG] mod_audio_stream.c:94 exiting start_capture.
f3a35eb3-20dc-4622-b116-074976147811 2024-08-21 15:09:36.614262 96.37% [DEBUG] audio_streamer_glue.cpp:135 sending initial metadata t

I received this "t" data 2 days ago, and today. After i receive, Channel hanging up.

Im really confused right now. Please help

SumyabazarBaatar commented 3 weeks ago

@amigniter

DanielSilvaol commented 1 week ago

@SumyabazarBaatar Good evening, I decided to change this variable to be immutable, in my case it resolved m_initial_meta(initialMeta ? strdup(initialMeta) : nullptr),

audio_streamer_glue.cpp

AudioStreamer(const char uuid, const char wsUri, responseHandler_t callback, int deflate, int heart_beat, const char initialMeta, bool globalTrace, bool suppressLog, const char extra_headers): m_sessionId(uuid), m_notify(callback), m_initial_meta(initialMeta ? strdup(initialMeta) : nullptr), m_global_trace(globalTrace), m_suppress_log(suppressLog), m_extra_headers(extra_headers), m_playFile(0) {