[Serusers] Mediaproxy Problems

dhiraj.2.bhuyan at bt.com dhiraj.2.bhuyan at bt.com
Thu Jul 8 18:29:34 CEST 2004


Hello List,

I have the following setup -


kphoneA------------- [SER A] ---------------- [SER B] ---------- kphoneB


I am forcing both SER A and B to use mediaproxy regardless of whether the UA's are natted or not (ser.cfg file attached).

When kphoneA makes a call to kphoneB, use_media_proxy() works fine on SER A. But on SER B, it fails (I can see an error - mediaproxy: Call-Id not found - but ethereal traffic dump shows that the Call-Id is present in the SIP message). So I get a call between khponeA---serA---kphoneB.

When I initiate the call from kphoneB, the whole thing reverses and it becomes kphoneB---serB----kphoneA.

I am using ser-0.8.12 (cannot use cvs version at the moment due to some code changed we have done) and mediaproxy-1.0.1.

Anyone got any clue where I am wrong? ser.cfg file attached. Any help will be greately appreciated.


Regards,

Dhiraj






---------------------- ser.cfg ----------------------------------




-------------------
#
# $Id$
#
# simple quick-start config script
#

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

debug=9          # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=yes	# (cmd line: -E)
check_via=no	# (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
port=5060
children=2
fifo="/tmp/ser_fifo"
sip_warning=yes

# ------------------ module loading ----------------------------------

# set the proper path to your modules modules
# if you did "make install" it must be, for example
# loadmodule "/usr/local/lib/ser/modules/sl.so"

loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"

# Uncomment this if you want to use SQL database
#loadmodule "../sip_router/modules/mysql/mysql.so"


loadmodule "/usr/local/lib/ser/modules/domain.so"
loadmodule "/usr/local/lib/ser/modules/dbtext.so"
loadmodule "/usr/local/lib/ser/modules/mediaproxy.so"
# ----------------- setting module-specific parameters ---------------

# -- usrloc params --

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

# Uncomment this if you want to use SQL database 
# for persistent storage and comment the previous line

# modparam("usrloc", "db_url", "sql://ser:heslo@localhost/ser")

# -- auth params --

# -- mediaproxy params --
modparam("mediaproxy", "mediaproxy_socket", "/var/run/proxydispatcher.sock")
modparam("mediaproxy", "sip_asymmetrics", "/etc/ser/sip-asymmetrics-clients")
modparam("mediaproxy", "rtp_asymmetrics", "/etc/ser/rtp-asymmetrics-clients")
modparam("mediaproxy", "natping_interval", 20)

modparam("domain", "db_url", "/usr/local/ser/domaintables")
modparam("domain", "domain_table", "domain")
modparam("domain", "domain_col", "domain")

# -------------------------  request routing logic -------------------

# main routing logic


route{

	# initial sanity checks -- messages with
	# max_forwars==0, or excessively long requests
	if (!mf_process_maxfwd_header("10")) {
		sl_send_reply("483","Too Many Hops");
		break;
	};
	if (msg:len >= max_len)
	{
		sl_send_reply("513", "Message too big");
		break;
	};

	record_route();
        # loose-route processing
        if (loose_route()) {
                t_relay();
                break;
        };

	if (client_nat_test("3")) {
		if (method == "REGISTER" || ! search("^Record-Route:")) {
			
			fix_contact();
			force_rport();
		};
	};

	if (uri==myself) {

		if (method=="REGISTER") {
			log("REGISTER");
			save("location");
			break;
		};

                lookup("location");
                if (!uri==myself) {
                        append_hf("P-hint: outbound alias\r\n"); 
                        route(1);
                        break;
                };

		# native SIP destinations are handled using our USRLOC DB
		if (!lookup("location")) {
			sl_send_reply("404", "Not Found");
			break;
		};
	};

        if (method=="INVITE") {
                use_media_proxy();
                t_on_reply("1");
        };

        if (method == "BYE" || method == "CANCEL") {
                end_media_session();
        };

        if (!uri==myself) {
                # mark routing logic in request
                append_hf("P-hint: outbound\r\n"); 
                route(1);
                break;
        };

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

route[1] 
{
	t_on_reply("1");
        if (!t_relay()) {
                sl_reply_error();
        };
}


onreply_route[1] {

    if (status=~"(183)|2[0-9][0-9]") {
        if (client_nat_test("1")) {
            fix_contact();
        };
        use_media_proxy();
    };

    if (status=~"[3-4]0[0-9]") {   
        end_media_session();
        break;
    };
}




More information about the sr-users mailing list