[SR-Users] Eternal config - Kamailio and rtpengine

Mihai Cezar cezar at mokalife.ro
Tue May 18 23:43:11 CEST 2021


Hi!

I use lxc containers with asterisk wich their are connecting to
kamailio, so far so good they work when i put the containers with
public ips, but when i switched to private ip I have one-way audio.

I tried to with rtpengine but no luck:

 rtpengine --table=42 --listen-ng=127.0.0.1:2223
--interface=56.12.19.100 --tos=184 --pidfile=/run/rtpengine.pid
--no-fallback --log-level=7 --log-facility=local3

the setup looks like this:
VM-KAMAILIO-(public ip 56.12.19.100 with static routes for the private
IP) --> LxC(n) (with private class 192.168.0.n)

The problem i think is when LxC asterisk is sending back the 200 OK
from Invite it puts his private ip in the sdp filed:

v=0
o=- 2171376102 3 IN IP4 192.168.0.2
s=Asterisk
c=IN IP4 192.168.0.2
t=0 0
m=audio 11336 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv


i've loaded the modules, but after this i am stuck....
loadmodule "nathelper.so"
loadmodule "rtpengine.so"
modparam("nathelper", "received_avp", "$avp(RECEIVED)")
modparam("nathelper", "nortpproxy_str", "a=sdpmangled:yes\r\n")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
modparam("nathelper", "sipping_from", "sip:pinger at proxy")

# params needed for NAT traversal in other modules
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
modparam("usrloc", "nat_bflag", FLB_NATB)

modparam("rtpengine", "rtpengine_sock", "udp:localhost:2223")
modparam("rtpengine", "rtpengine_retr", 2)
modparam("rtpengine", "hash_table_size", 256)
modparam("rtpengine", "hash_table_tout", 600)



More information about the sr-users mailing list