Skip to content

The soft phone cannot receive echo. #4

@xiaoguanzi

Description

@xiaoguanzi

Please help me.

I installed freeswitch 1.10.12 on CentOS 7 and your module from https://github.com/voxcom-us/mod_audio_stream.
Then I ran your echo example, but I couldn't hear any sound in the record_session or in the linephone. However, the recording file from echo.py could be heard. Could you please tell me if you could hear the echo when running it? I tried with 9196 and could hear the echo. And I made sure that the RTP ports were all open.

This is my configuration.
freeswitch conf
default.xml

   <condition field="destination_number" expression="^602[0-9]$">
          <action application="set" data="x_fs_path=${network_addr}" />
          <action application="set" data="dialed_number=$1" />
          <action application="lua" data="/usr/local/freeswitch/share/freeswitch/scripts/dialplan.lua" />
       </condition>

diaplan.lua

pi = freeswitch.API()

local channel_id = session:get_uuid()

session:execute("set", "playback_delimiter=!")
session:execute("answer")
local caller_id_number = session:getVariable("caller_id_number")
session:execute("set", "result=${uuid_audio_stream ${uuid} start ws://172.16.25.3:18081/live/${uuid} mono 16000}")
freeswitch.consoleLog("INFO", "call answered with channel id [" .. channel_id .. "]")
session:execute("record_session", "/tmp/${uuid}.wav")
session:execute("park")

The webserver is consistent with your echo.py code. I only changed the running port.
Currently, the recorded files saved by echo.py can be heard with my voice, but the linephone softphone cannot hear the echo sent back by the websocket.
This is part of the log from the freeswitch console:

2026-01-27 20:21:47.574664 99.27% [DEBUG] mod_dptools.c:1671 SET sofia/internal/1000@xxx.xx.xxx.xx [result]=[+OK Success ] 2026-01-27 20:21:47.574664 99.27% [INFO] switch_cpp.cpp:1466 call answered with channel id [cbe17d75-3d0c-4393-a6ad-170e34fd2d15] EXECUTE [depth=0] sofia/internal/1000@xxx.xx.xxx.xx record_session(/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15.wav) 2026-01-27 20:21:47.594665 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_0.tmp.r16"} 2026-01-27 20:21:47.594665 99.27% [DEBUG] switch_ivr_async.c:1504 Record session sample rate: 8000 -> 8000 2026-01-27 20:21:47.594665 99.27% [DEBUG] switch_core_media_bug.c:976 Attaching BUG to sofia/internal/1000@xxx.xx.xxx.xx EXECUTE [depth=0] sofia/internal/1000@xxx.xx.xxx.xx park() 2026-01-27 20:21:47.594665 99.27% [DEBUG] switch_ivr_async.c:1778 No silence detection configured; assuming start of speech 2026-01-27 20:21:47.674665 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_1.tmp.r16"} 2026-01-27 20:21:47.774666 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_2.tmp.r16"} 2026-01-27 20:21:47.854663 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_3.tmp.r16"} 2026-01-27 20:21:47.954664 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_4.tmp.r16"} 2026-01-27 20:21:48.034665 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_5.tmp.r16"} 2026-01-27 20:21:48.134668 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_6.tmp.r16"} 2026-01-27 20:21:48.214664 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_7.tmp.r16"} 2026-01-27 20:21:48.314663 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_8.tmp.r16"} 2026-01-27 20:21:48.374663 99.27% [DEBUG] sofia.c:7493 Channel sofia/internal/1000@xxx.xx.xxx.xx entering state [ready][200] 2026-01-27 20:21:48.394667 99.27% [NOTICE] switch_rtp.c:1440 Auto Changing audio stun/rtp/dtls port from xxx.xx.xxx.xx:21378 to xxx.xx.xxx.xx:10080 idx:-1 2026-01-27 20:21:48.394667 99.27% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_9.tmp.r16"} 2026-01-27 20:21:48.434664 99.23% [DEBUG] switch_rtp.c:1934 rtcp_stats_init: audio ssrc[2148024280] base_seq[14] 2026-01-27 20:21:48.434664 99.23% [DEBUG] switch_core_io.c:448 Setting BUG Codec PCMU:0 2026-01-27 20:21:48.474664 99.23% [NOTICE] switch_rtp.c:1440 Auto Changing audio stun/rtp/dtls port from xxx.xx.xxx.xx:10080 to xxx.xx.xxx.xx:21378 idx:-1 2026-01-27 20:21:48.494664 99.23% [DEBUG] audio_streamer_glue.cpp:259 response: {"audioDataType":"raw","sampleRate":16000,"file":"/tmp/cbe17d75-3d0c-4393-a6ad-170e34fd2d15_10.tmp.r16"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions