[Users] invalid port returned by mediaproxy

Kenny Chua strain15 at yahoo.com
Mon Jun 19 05:32:55 CEST 2006


Hello, I'm trying to implement mediaproxy with my openser. I'm getting this error:

local /usr/local/sbin/openser[2781]: error: use_media_proxy(): invalid port returned by mediaproxy: #

I've forwarded all ports that are required. I'm having problems with sip2sip (no audio).

Also, for SIP to PSTN, I'm having problems too.
The call goes through the PSTN gateway and actually connects. However, its still one way audio or sometimes no audio at all. I'm using FC5 with openser 1.0.1. Mediaproxy 1.7.2. Below are my configuration files for media proxy and openser.cfg:

**************************************Openser.cfg*********************************
debug=3
fork=yes
log_stderror=no

listen=192.168.1.5        # This is where OpenSER installed
port=5060
children=4

alias=mydomain.com     # This is where OpenSER installed

dns=no
rev_dns=no

fifo="/tmp/openser_fifo"
fifo_db_url="mysql://openser:openserrw@localhost/openser"

loadmodule "/usr/local/lib/openser/modules/mysql.so"
loadmodule "/usr/local/lib/openser/modules/sl.so"
loadmodule "/usr/local/lib/openser/modules/tm.so"
loadmodule "/usr/local/lib/openser/modules/rr.so"
loadmodule "/usr/local/lib/openser/modules/maxfwd.so"
loadmodule "/usr/local/lib/openser/modules/usrloc.so"
loadmodule "/usr/local/lib/openser/modules/registrar.so"
loadmodule "/usr/local/lib/openser/modules/auth.so"
loadmodule "/usr/local/lib/openser/modules/auth_db.so"
loadmodule "/usr/local/lib/openser/modules/uri.so"
loadmodule "/usr/local/lib/openser/modules/uri_db.so"
loadmodule "/usr/local/lib/openser/modules/mediaproxy.so"
loadmodule "/usr/local/lib/openser/modules/nathelper.so"
loadmodule "/usr/local/lib/openser/modules/textops.so"
loadmodule "/usr/local/lib/openser/modules/domain.so"
loadmodule "/usr/local/lib/openser/modules/acc.so"
loadmodule "/usr/local/lib/openser/modules/xlog.so"

modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "use_domain", 1)

modparam("domain", "db_mode", 1)

modparam("nathelper", "rtpproxy_disable", 1)
modparam("nathelper", "natping_interval", 180)

modparam("mediaproxy","natping_interval", 30)
modparam("mediaproxy","mediaproxy_socket", "/var/run/mediaproxy.sock")
modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/openser/sip-asymmetric-clients")
modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/openser/rtp-asymmetric-clients")

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

modparam("registrar", "default_expires", 60)
modparam("registrar", "min_expires", 30)
modparam("registrar", "nat_flag", 6)
modparam("registrar", "use_domain", 1)

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

modparam("acc", "db_url", "mysql://openser:openserrw@localhost/openser")
modparam("acc", "failed_transaction_flag", 1)
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1)
modparam("acc", "db_flag", 1)

route {

        # -----------------------------------------------------------------
        # Sanity Check Section
        # -----------------------------------------------------------------
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483", "Too Many Hops");
                exit;
        };

        if (msg:len > max_len) {
                sl_send_reply("513", "Message Overflow");
                exit;
        };

        # -----------------------------------------------------------------
        # Record Route Section and Acc section
        # -----------------------------------------------------------------
        if (method=="INVITE" && client_nat_test("3")) {
                record_route_preset("192.168.1.5:5060;nat=yes");        # This is where OpenSER installed
        } else if (method!="REGISTER") {
            record_route();    
        };

        # -----------------------------------------------------------------
        # Call Tear Down Section
        # -----------------------------------------------------------------
        if (method=="BYE" || method=="CANCEL") {
                end_media_session();
        };

        # -----------------------------------------------------------------
        # Loose Route Section
        # -----------------------------------------------------------------
        if (loose_route()) {

                if (has_totag() && (method=="INVITE" || method=="ACK")) {

                        if (client_nat_test("3") || search("^Route:.*;nat=yes")) {
                                setflag(6);
                                use_media_proxy();
                        };
                };

                route(1);
        };

        # -----------------------------------------------------------------
        # Call Type Processing Section
        # -----------------------------------------------------------------

        if (uri!=myself) {
        route(1);
        return;
        };

        if (uri==myself) {

                if (method=="CANCEL") {
                        route(3);
                        return;
                } else if (method=="INVITE") {
            xlog("URI is myself, forward to route 3\n");
                        route(3);
                        return;
                } else  if (method=="REGISTER") {
                        route(2);
                        return;
                };

                lookup("aliases");
                if (uri!=myself) {
                        route(1);
                        return;
                };

                if (!lookup("location")) {
                        sl_send_reply("404", "User Not Found");
                        exit;
                };
        };

        route(1);
}

route[1] {

        # -----------------------------------------------------------------
        # Default Message Handler
        # -----------------------------------------------------------------

        t_on_reply("1");

        if (!t_relay()) {

                if (method=="INVITE" || method=="ACK") {
                        end_media_session();
                };

                sl_reply_error();
        };
}

route[2] {

        # -----------------------------------------------------------------
        # REGISTER Message Handler
        # ----------------------------------------------------------------

        if (!search("^Contact:\ +\*") && client_nat_test("7")) {
                setflag(6);
                fix_nated_register();
                force_rport();
        };

        sl_send_reply("100", "Trying");

        if (!www_authorize("mydomain.com","subscriber")) {
                www_challenge("mydomain.com","0");
                exit;
        };

        if (!check_to()) {
                sl_send_reply("401", "Unauthorized");
                exit;
        };

        consume_credentials();

        if (!save("location")) {
                sl_reply_error();
        };
}

route[3] {

        # -----------------------------------------------------------------
        # CANCEL and INVITE Message Handler
        # -----------------------------------------------------------------
    xlog("Call Invite\n");
        if (client_nat_test("3")) {
                setflag(7);
                force_rport();
                fix_nated_contact();
        };

        lookup("aliases");
      

        if (uri=~"^sip:1[0-9]*@*") {
         xlog("PSTN Gateway\n");
         use_media_proxy();
         rewritehostport("pstn.gateway.com:5060");     # This is where PSTN         
         route(1);
         exit;
         
        };

        if (!lookup("location")) {
                sl_send_reply("404", "User Not Found");
                exit;
        };

        if (method=="CANCEL") {
                route(1);
                exit;
        };

        if (!proxy_authorize("","subscriber")) {
                proxy_challenge("","0");
                return;
        } else if (!check_from()) {
                sl_send_reply("403", "Use From=ID");
                return;
        };

        consume_credentials();

        if (isflagset(6) || isflagset(7)) {
                use_media_proxy();
        };

        route(1);
}

onreply_route[1] {

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

                if (!search("^Content-Length:\ +0")) {
                        use_media_proxy();
                };
        };

        if (client_nat_test("1")) {
                fix_nated_contact();
        };
}

***************************Mediaproxy.ini******************************************
[Dispatcher]
;start = yes
socket = /var/run/proxydispatcher.sock
;group = ser
defaultProxy = /var/run/mediaproxy.sock

[MediaProxy]
start = yes
socket = /var/run/mediaproxy.sock
group = ser
listen = None
allow = None
proxyIP = 192.168.1.5        # This is where OpenSER installed
portRange = 21000:35000        # These values are set same in ATA's configs for RTP Range
TOS = 0xb8
idleTimeout = 60
holdTimeout = 180
forceClose = 0
accounting = off

[Accounting]
user = root
password =
host = localhost
database = ser
table = acc


Can anyone figure out my problem? Thank you in advance


 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20060618/d1c3c9eb/attachment.htm 


More information about the Users mailing list