<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi everyone,<br><br>I'm trying to make kamailio works as a SBC in front of Asterisk. I have read the tutorial <a href="http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb" target="_blank">http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb</a> and it is close to what I'm looking for but still a little different. I want don't want kamailio to do auth and I want it to be a media gateway. The media and SIP path have to look like that:<br><br>Phone 1 ----- kamailio -----Asterisk ---- Kamailio ---- Phone 2<br><br><br>First I have add an outboundproxy field in the Asterisk configuration to make all SIP messages from Asterisk passe through Kamailio. Then I started a minimal conf for Kamailio and it works at least for the SIP part. Call can be established perfectly. <br><br>However the RTP proxy part is a mess. Kamailio changes the IP address in the sdp part only for INVITE messages and not for the 200 OK responses, so there is only one side of the media passing through Kamailio, the other side is sent directly to asterisk. But even for the half part rtpproxy craches with a segfault and Kamailio doesn't transmit this media.<br><br>I have been searching some helps on google but nothing so far :/ I hope that someone here could help me.<br><br>-----------------------------------------------<br>#!KAMAILIO<br><br>####### Defined Values #########<br><br><br>#!define ASTERISK 192.168.51.43<br><br>####### Global Parameters #########<br><br>#!ifdef WITH_DEBUG<br>debug=4<br>log_stderror=no<br>#!else<br>debug=2<br>log_stderror=no<br>#!endif<br><br>memdbg=5<br>memlog=5<br><br>log_facility=LOG_LOCAL0<br><br>fork=yes<br>children=2<br><br>auto_aliases=no<br><br># to avoid simple attacks, use unconventional port<br>port=5060<br><br><br><br><br>####### Modules Section ########<br><br>mpath="/usr/local/lib/kamailio/modules"<br><br>loadmodule "db_text.so"<br><br>loadmodule "mi_fifo.so"<br>loadmodule "kex.so"<br>loadmodule "sl.so"<br>loadmodule "rr.so"<br>loadmodule "pv.so"<br>loadmodule "maxfwd.so"<br>loadmodule "textops.so"<br>loadmodule "siputils.so"<br>loadmodule "xlog.so"<br>loadmodule "sanity.so"<br>loadmodule "ctl.so"<br>loadmodule "cfg_rpc.so"<br>loadmodule "mi_rpc.so"<br>loadmodule "path.so"<br>loadmodule "rtpproxy.so"<br><br><br>#!ifdef WITH_DEBUG<br>loadmodule "debugger.so"<br>#!endif<br><br># ----------------- setting module-specific parameters ---------------<br><br><br>modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")<br><br><br># add value to ;lr param to cope with most of the UAs<br>modparam("rr", "enable_full_lr", 1)<br># do not append from tag to the RR (no need for this script)<br>modparam("rr", "append_fromtag", 0)<br><br><br>modparam("path", "use_received", 1)<br><br>modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")<br><br><br>#!ifdef WITH_DEBUG<br># ----- debugger params -----<br>modparam("debugger", "cfgtrace", 1)<br>#!endif<br><br>####### Routing Logic ########<br><br><br>route {<br>    xlog("L-ALERT", "new message !!!!!!!!!!!!!!!");<br>    if (!sanity_check()) {<br>        exit;<br>    }<br><br>    if ( !mf_process_maxfwd_header("10") )<br>    {<br>        sl_send_reply("483","To Many Hops");<br>        xlog("L_NOTICE", "$si $rm $ru -- too many hops\n");<br>        exit;<br>    }<br><br>    if (af==INET)<br>    {<br>        force_rport();<br><br>        if (src_ip != ASTERISK)<br>        {<br>            $du = "sip:192.168.51.43:5060";<br>            add_path_received();<br>            route(RTPPROXY);<br>            record_route();<br>        }<br>        else<br>        {<br>            loose_route();<br>            route(RTPPROXY);<br>            record_route();<br>        }<br>    }<br><br>    forward();<br>}<br><br><br>route[RTPPROXY] {<br><br>        rtpproxy_manage("cwei");<br><br>}<br><br>onreply_route {<br><br>    if (af==INET)<br>    {<br>        rtpproxy_manage("cwei");<br>    }<br><br>    return(1);<br>}<br><br>---------------------------------------------<br><br><br>Guillaume<br>                                           </div></body>
</html>