[RTPproxy Users] Sometimes YES sometime NO rtp packets

Luis Guaman luis.guaman at interlancompu.com
Tue Sep 15 05:28:52 PDT 2009


 

Hi list,

 

We have one Kamailio server with public ip on Internet and two uac’s behind
different nats.

 

The problem is that sometimes rtp packets flow normally in a call. Sometimes
in other call there is no rtp, audio in both ends same config. At this call,
no rtp, we can get rtp packets with hold/unhold events. 

Thanks in advance.

 

I am using Kamailio 1.5.2-tls on Lenny Linux Srv1 2.6.26-2-686 #1 SMP i686
GNU/Linux with rtpproxy:

Srv1:/usr/local/etc/kamailio# rtpproxy -v

Basic version: 20040107

Extension 20050322: Support for multiple RTP streams and MOH

Extension 20060704: Support for extra parameter in the V command

Extension 20071116: Support for RTP re-packetization

Extension 20071218: Support for forking (copying) RTP stream

Extension 20080403: Support for RTP statistics querying

Extension 20081102: Support for setting codecs in the update/lookup command

Extension 20081224: Support for session timeout notifications

Extension 20090810: Support for automatic bridging

Rtpproxy is run as follow:

/usr/local/bin/rtpproxy -u rtpproxy -l 200.XXX.XX.XXX -s udp:localhost:7722

 

It Sometime works fine, ie rtp flows normal:

===RTP YES===

DBUG:handle_command: received command "25837_10 Uc18,4,101
YmRjZmE5NWM5MmRkMjQ3YmJjNWI5YWFlNGNhZTU1NDk. 186.66.71.118 21578 b309ba09;1"

INFO:handle_command: new session
YmRjZmE5NWM5MmRkMjQ3YmJjNWI5YWFlNGNhZTU1NDk., tag b309ba09;1 requested, type
strong

INFO:handle_command: new session on a port 38588 created, tag b309ba09;1

INFO:handle_command: pre-filling caller's address with 186.66.71.118:21578

DBUG:doreply: sending reply "25837_10 38588 200.xxx.xx.xxx

"

DBUG:handle_command: received command "25839_6 Lc18,101
YmRjZmE5NWM5MmRkMjQ3YmJjNWI5YWFlNGNhZTU1NDk. 190.152.165.48 20514 b309ba09;1
0d4da661;1"

INFO:handle_command: lookup on ports 38588/58568, session timer restarted

INFO:handle_command: pre-filling callee's address with 190.152.165.48:20514

DBUG:doreply: sending reply "25839_6 58568 200.xxx.xx.xxx

"

DBUG:handle_command: received command "25839_7 Lc18,101
YmRjZmE5NWM5MmRkMjQ3YmJjNWI5YWFlNGNhZTU1NDk. 190.152.165.48 20514 b309ba09;1
0d4da661;1"

INFO:handle_command: lookup on ports 38588/58568, session timer restarted

DBUG:doreply: sending reply "25839_7 58568 200.xxx.xx.xxx

"

DBUG:handle_command: received command "25839_8 Lc18,101
YmRjZmE5NWM5MmRkMjQ3YmJjNWI5YWFlNGNhZTU1NDk. 190.152.165.48 20514 b309ba09;1
0d4da661;1"

INFO:handle_command: lookup on ports 38588/58568, session timer restarted

DBUG:doreply: sending reply "25839_8 58568 200.xxx.xx.xxx

"

INFO:rxmit_packets: caller's address filled in: 186.66.71.118:1030 (RTP

 

        ==TearDownRTPYES===

        DBUG:handle_command: received command "25839_9 D
YmRjZmE5NWM5MmRkMjQ3YmJjNWI5YWFlNGNhZTU1NDk. b309ba09 0d4da661"

INFO:handle_delete: forcefully deleting session 1 on ports 38588/58568

INFO:remove_session: RTP stats: 1702 in from callee, 1562 in from caller,
3264 relayed, 0 dropped

INFO:remove_session: RTCP stats: 7 in from callee, 7 in from caller, 14
relayed, 0 dropped

INFO:remove_session: session on ports 38588/58568 is cleaned up

DBUG:doreply: sending reply "25839_9 0

"

 

Sometime rtp don’w flows.

====No RTP====

DBUG:handle_command: received command "25840_5 Uc18,4,101
MGZjYTk4Yjc0YTZkNzI4YTdhZDUxZGZkMzE0ZDA5Yzk. 186.66.71.118 21586 1e4c8b45;1"

INFO:handle_command: new session
MGZjYTk4Yjc0YTZkNzI4YTdhZDUxZGZkMzE0ZDA5Yzk., tag 1e4c8b45;1 requested, type
strong

INFO:handle_command: new session on a port 57504 created, tag 1e4c8b45;1

INFO:handle_command: pre-filling caller's address with 186.66.71.118:21586

DBUG:doreply: sending reply "25840_5 57504 200.xxx.xx.xxx

"

DBUG:handle_command: received command "25838_10 Lc18,101
MGZjYTk4Yjc0YTZkNzI4YTdhZDUxZGZkMzE0ZDA5Yzk. 190.152.165.48 20522 1e4c8b45;1
7d31770c;1"

INFO:handle_command: lookup on ports 57504/55194, session timer restarted

INFO:handle_command: pre-filling callee's address with 190.152.165.48:20522

DBUG:doreply: sending reply "25838_10 55194 200.xxx.xx.xxx

"

INFO:rxmit_packets: caller's address filled in: 186.66.71.118:1030 (RTP)

INFO:rxmit_packets: callee's address filled in: 192.168.50.30:20522 (RTP)

INFO:rxmit_packets: guessing RTCP port for callee to be 20523

INFO:rxmit_packets: callee's address filled in: 190.152.165.48:20523 (RTCP)

INFO:rxmit_packets: caller's address filled in: 186.66.71.118:1030 (RTCP)

        ===TearDownNoRTP==

        

DBUG:handle_command: received command "25839_10 D
MGZjYTk4Yjc0YTZkNzI4YTdhZDUxZGZkMzE0ZDA5Yzk. 1e4c8b45 7d31770c"

INFO:handle_delete: forcefully deleting session 1 on ports 57504/55194

INFO:remove_session: RTP stats: 2 in from callee, 7324 in from caller, 7326
relayed, 0 dropped

INFO:remove_session: RTCP stats: 30 in from callee, 31 in from caller, 61
relayed, 0 dropped

INFO:remove_session: session on ports 57504/55194 is cleaned up

DBUG:doreply: sending reply "25839_10 0

 

 

Kamailio config:

# ----------- global configuration parameters ------------------------

 

debug=4            # debug level (cmd line: -dddddddddd)

fork=yes

log_stderror=no# (cmd line: -E)

 

 

check_via=no    # (cmd. line: -v)

dns=no          # (cmd. line: -r)

rev_dns=no      # (cmd. line: -R)

port=5060

children=6

listen=udp:200.xxx:5060

server_header = "Server: SIP Proxy V1.5.2-tls"

user_agent_header = "Server:  SIP Proxy V1.5.2-tls"

alias=xxxx

 

/* uncomment the following lines to enable TLS support  (default off) */

disable_tls = no

listen = tls:xxxx:5061

tls_verify_server = 1

tls_verify_client = 1

tls_require_client_certificate = 0

tls_method = TLSv1

tls_certificate = "/usr/local/etc/kamailio/tls/user/user-cert.pem"

tls_private_key = "/usr/local/etc/kamailio/tls/user/user-privkey.pem"

tls_ca_list     = "/usr/local/etc/kamailio/tls/user/user-calist.pem"

 

 

# --- module loading

 

mpath="/usr/local/lib/kamailio/modules/"

 

loadmodule "mi_fifo.so"

loadmodule "db_mysql.so"

loadmodule "sl.so"

loadmodule "tm.so"

loadmodule "rr.so"

loadmodule "maxfwd.so"

loadmodule "usrloc.so"

loadmodule "registrar.so"

loadmodule "textops.so"

loadmodule "nathelper.so"

loadmodule "auth.so"

loadmodule "auth_db.so"

loadmodule "pv.so"

loadmodule "siputils.so"

loadmodule "avpops.so"

loadmodule "xlog.so"

loadmodule "uac.so"

loadmodule "perl.so"

loadmodule "htable.so"

 

# --- setting module parameters

 

# -- mi_fifo params --

modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")

 

modparam("usrloc|auth_db","db_url","mysql://openser:xxx@localhost/openser")

 

# -- usrloc params --

modparam("usrloc", "db_mode", 2)

modparam("usrloc", "nat_bflag", 6)

 

# -- registrar params --

modparam("registrar|nathelper", "received_avp", "$avp(i:42)")

 

# -- auth params --

modparam("auth_db", "calculate_ha1", 0)

modparam("auth_db", "password_column", "ha1")

 

# -- rr params --

modparam("rr", "enable_full_lr", 1)

 

# -- nathelper

modparam("nathelper", "rtpproxy_sock", "udp:localhost:7722")

modparam("nathelper", "natping_interval", 30)

modparam("nathelper", "ping_nated_only", 1)

modparam("nathelper", "sipping_bflag", 7)

modparam("nathelper", "sipping_from", "sip:pinger at xxxxx")

 

# -- perl

modparam("perl", "modpath", "/usr/local/lib/kamailio/perl")

modparam("perl", "filename", "/usr/local/etc/kamailio/voipprepago.pl")

 

modparam("htable", "htable", "intentoslogin=>size=4;")

 

# --- main routing logic

route{

        if (!mf_process_maxfwd_header("10")) {

                sl_send_reply("483","Too Many Hops");

                exit;

        };

        if (msg:len >=  2048 ) {

                sl_send_reply("513", "Message too big");

                exit;

        };

        if (uri==myself) {

        if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) {

                options_reply();

        }

        }

        # NAT detection

        route(2);

 

        if (!method=="REGISTER")

                record_route();

 

        if (loose_route()) {

                append_hf("P-hint: rr-enforced\r\n"); 

                route(1);

        };

 

        if (!uri==myself) {

                append_hf("P-hint: outbound\r\n"); 

                route(1);

        };

 

        if (uri==myself) {

                if (method=="REGISTER") {

                        if (!www_authorize("xxxx", "subscriber")) {

                               www_challenge("xxxx", "0");

                               exit;

                        };

 

                        if (isflagset(5)) {

                               setbflag(6);

                               # if you want OPTIONS natpings uncomment next

                                setbflag(7);

                        };

                        save("location","0x04");

                        exit;

                };

 

                if (!lookup("location")) {

                        sl_send_reply("404", "Not Found");

                        exit;

                };

 

                append_hf("P-hint: usrloc applied\r\n"); 

        };

 

        route(1);

}

route[1] {

        if (subst_uri('/(sip:.*);nat=yes/\1/')){

                setbflag(6);

        };

 

        if (isflagset(5)||isbflagset(6)) {

                route(3);

        }

 

        if (!t_relay()) {

                sl_reply_error();

        };

        exit;

}

 

route[2]{

        force_rport();

        if (nat_uac_test("19")) {

                if (method=="REGISTER") {

                        fix_nated_register();

                } else {

                        fix_nated_contact();

                };

                setflag(5);

        };

}

 

route[3] 

{

        if (is_method("BYE|CANCEL")) {

                unforce_rtp_proxy();

        } else if (is_method("INVITE")){

        force_rtp_proxy("o");

 

                t_on_failure("1");

        };

        if (isflagset(5))

        search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');

        t_on_reply("1");

}

 

failure_route[1] {

        if (isbflagset(6) || isflagset(5)) {

                unforce_rtp_proxy();

        }

}

 

onreply_route[1] 

{

        if ((isflagset(5) || isbflagset(6)) &&
status=~"(183)|(2[0-9][0-9])") {

                log(2, "Enabling RTPProxy ONREPLY_ROUTE1");

                 xlog(" dd: $avp(i:450) srcip: $src_ip\n");

                force_rtp_proxy("o");

       };

 

        search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');

 

        if (isbflagset(6)) {

                fix_nated_contact();

        }

        exit;

}

 

Atentamente,

 

Luis Guamán

República 396 y Diego de Almagro

Ph:+593.2.2526585

Cel:+593.9.4264354

Quito - Ecuador

logoReducido

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rtpproxy.org/pipermail/users/attachments/20090915/46afb06d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 2051 bytes
Desc: not available
Url : http://lists.rtpproxy.org/pipermail/users/attachments/20090915/46afb06d/attachment-0001.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 8506 bytes
Desc: not available
Url : http://lists.rtpproxy.org/pipermail/users/attachments/20090915/46afb06d/attachment-0001.jpeg 


More information about the Users mailing list