Control and monitor Baresip via JSON messages

48 views
Skip to first unread message

Vladimir B

unread,
Dec 8, 2025, 3:34:39 AM12/8/25
to baresip
Hi all, mb some one can help me with that. I trying connect to Baresip via ctrl_tcp by requests (POST, GET), but nothing happens. I used request with json bodys lika says in here: 
I used postman for that(look at attached file).



this is my conf: 
# Application Modules

module_app              account.so
module_app              contact.so
module_app              debug_cmd.so
#module_app             echo.so
#module_app             gtk.so
module_app              menu.so
#module_app             mwi.so
#module_app             presence.so
#module_app             serreg.so
module_app              syslog.so
#module_app             mqtt.so
module_app              ctrl_tcp.so
#module_app             ctrl_dbus.so
module_app              httpreq.so
module_app              netroam.so
module_app              auloop.so

# UI Modules parameters
cons_listen             0.0.0.0:5555 # cons - Console UI UDP/TCP sockets

http_listen             0.0.0.0:8000 # httpd - HTTP Server

ctrl_tcp_listen         0.0.0.0:4444 # ctrl_tcp - TCP interface JSON

evdev_device            /dev/input/event0

Screenshot from 2025-12-08 11-32-24.png

يوسف عبد الحق

unread,
Dec 15, 2025, 4:55:53 AM12/15/25
to baresip
ctrl_tcp doesn't work with http. You need to connect to the ctrl_tcp port, and send a netstring json , and listen on the socket for responses and parse them also with netstring . Since tcp has no request/response in the protocol itself (like http), you need to send a field token that will get sent back to you, so that you know which response matches which request.

You could use the http interface, and send POST and GET. But that's not ctrl_tcp, that's httpd
Reply all
Reply to author
Forward
0 new messages