instale el rtp proxy en otro servidor
en los LOGs de rtp ahora sale

Mar 23 17:09:22 id206222g rtpproxy[15666]: DBUG:handle_command: received command "9624_5 Uc0,101 603bba72006d127cYTg1Mzc4Y2NiOTJiNjcyMTVjMjJiMDM2MGY3NmRhMWY. 186.153.73.221 62180 b7656927;1"
Mar 23 17:09:22 id206222g rtpproxy[15666]: INFO:handle_command: new session 603bba72006d127cYTg1Mzc4Y2NiOTJiNjcyMTVjMjJiMDM2MGY3NmRhMWY., tag b7656927;1 requested, type strong
Mar 23 17:09:22 id206222g rtpproxy[15666]: INFO:handle_command: new session on a port 46004 created, tag b7656927;1
Mar 23 17:09:22 id206222g rtpproxy[15666]: INFO:handle_command: pre-filling caller's address with 186.153.73.221:62180
Mar 23 17:09:22 id206222g rtpproxy[15666]: DBUG:doreply: sending reply "9624_5 46004 187.49.226.42 "

PERO SIGUE SIN AUDIO EN UNA PUNTA.


Por favor dame una luz

envio mi configuracion, porque no se mas donde encontrar errores

----------------------------------------------------------------------------------------------------------------------------------------------------


####### Global Parameters #########

debug=3
log_stderror=no
log_facility=LOG_LOCAL0

fork=yes
children=4


port=5060

listen=udp:65.254.63.212:5060


####### Modules Section ########

#set module path
mpath="/usr/local/lib/opensips/modules/"

loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "maxfwd.so"
loadmodule "avpops.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
loadmodule "rr.so"
loadmodule "acc.so"
loadmodule "domain.so"
loadmodule "load_balancer.so"
loadmodule "dialog.so"
loadmodule "auth.so"
loadmodule "auth_db.so"
loadmodule "siptrace.so"
loadmodule "nathelper.so"
loadmodule "rtpproxy.so"


# ----------------- setting module-specific parameters ---------------
modparam("load_balancer", "db_url","mysql://opensips:prueba@localhost/opensips")


# ----- siptrace -----
modparam("siptrace", "db_url", "mysql://opensips:prueba@localhost/opensips")
modparam("siptrace", "trace_flag", 22)
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "enable_ack_trace", 1)
#modparam("siptrace", "traced_user_avp", "$avp(123)")
#modparam("siptrace", "traced_user_avp", "$avp(user)")


# ----- rtpproxy -----
modparam("rtpproxy", "rtpproxy_sock","udp:187.49.226.42:7890")

# ----- dialog -----
#modparam("dialog", "dlg_flag", 13)
modparam("dialog", "db_mode", 1)
modparam("dialog", "db_url", "mysql://opensips:prueba@localhost/opensips")


# ----- nathelper -----
modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "natping_processes", 3)
modparam("nathelper", "natping_socket", "localhost:5006")
modparam("nathelper", "received_avp", "$avp(42)")
modparam("nathelper", "force_socket", "localhost:33333")
modparam("nathelper", "sipping_from", "sip:pinger@localhost")
modparam("nathelper", "sipping_method", "INFO")

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


# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")


# ----- rr params -----
modparam("rr","enable_double_rr",1)
modparam("rr","append_fromtag",1)



# ----- usrloc params -----
/* uncomment the following lines if you want to enable DB persistency   for location entries */
modparam("usrloc", "db_mode",   2)
modparam("usrloc", "db_url","mysql://opensips:prueba@localhost/opensips")

# ----- uri params -----
#modparam("uri_db", "use_uri_table", 0)
#modparam("uri_db", "db_url", "mysql://opensips:prueba@localhost/opensips")



# ----- acc params -----
/* what sepcial events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_cancels", 1)
/* by default ww do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
/* uncomment the following lines to enable DB accounting also */
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)


# ----- auth_db params -----
/* uncomment the following lines if you want to enable the DB basedauthentication */
modparam("auth_db", "password_column", "password")
modparam("auth_db", "password_column_2", "ha1b")
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "db_url","mysql://opensips:prueba@localhost/opensips")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "skip_version_check", 1)

# ----- alias_db params -----
/* uncomment the following lines if you want to enable the DB based   aliases */
#modparam("alias_db", "db_url","mysql://opensips:prueba@localhost/opensips")

# ----- domain params -----
/* uncomment the following lines to enable multi-domain detectionsupport */
modparam("domain", "db_url","mysql://opensips:prueba@localhost/opensips")
modparam("domain", "db_mode", 1)   # Use caching


# ----- multi-module params -----
/* uncomment the following line if you want to enable multi-domain supportin the modules (dafault off) */
modparam("auth_db|usrloc|uri", "use_domain", 1)



####### Routing Logic ########

route {
    $avp(s : user) = $fu; #for sip_trace
    # -----------------------------------------------------------------
    # Sanity Check Section
    # -----------------------------------------------------------------
    if (!mf_process_maxfwd_header("256")) {
        if (method != "ACK") {
            sl_send_reply("483", "Too Many Hops");
        }
        return;
    }
    if (msg:len > max_len) {
        if (method != "ACK") {
            sl_send_reply("513", "Message Overflow");
        }
        return;
    }

    if (status == "482") { #loop detection
        xlog("L_ERR", "Webur: $mi $rm $fu -> $ru status 482 Loop Detected\n");
        return;
    }

    if (!mf_process_maxfwd_header("3")) {
        sl_send_reply("483", "looping");
        exit;
    }

    if (!has_totag()) {
        # initial request

    } else {
        # sequential request -> obey Route indication
        loose_route();
        t_relay();
        exit;
    }

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

    if (method == "INVITE") {
        route(3);
        return;
    } else
        if (method == "ACK") {
            route(9);
            return;
        } else
            if (method == "BYE" || method == "CANCEL") {
                route(5);
                return;
            } else
                if (method == "REGISTER" || method == "MESSAGE") {
                    route(1);
                    return;
                } else
                    if (method == "PUBLISH" || method == "SUBSCRIBE") {

                        return;
                    } else
                        if (method == "NOTIFY") {
                            sl_send_reply("200", "Understood");
                            return;
                        } else
                            if (method == "OPTIONS") {
                                sl_send_reply("200", "Got it");
                                return;
                            }
}


route[1] {

    # -----------------------------------------------------------------
    # Register
    # -----------------------------------------------------------------

    if (is_method("REGISTER")) {
        route(4);
        if (isflagset(5)) {
            record_route(";nat=yes");
        } else {
            record_route();
        }


        if (!www_authorize("", "a2billing")) {
            www_challenge("", "0");
        }
        # auth done -> send it to registrar
        consume_credentials();
        $du = "sip:65.254.63.212:5060";
        save("location");
        t_relay();
        exit;
    }
}

route[3] {
    # -----------------------------------------------------------------
    # Handle Calls
    # -----------------------------------------------------------------
    xlog("L_INFO", "Place Holder");
    if (!has_totag()) {
        if (is_method("INVITE")) {
            trace_dialog();
        } else {
            sip_trace();
        }
    }

    if (loose_route()) {
        if (!has_totag()) {
            xlog("L_INFO", "Initial loose-routing rejected - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
            sl_send_reply("403", "Initial Loose-Routing Rejected");
            exit;
        }
        if (is_method("INVITE")) {

            route(5);
        }

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

    # NAT detection
    route(4);
    record_route();

    if ($rU =~ "^[0-9]{3}$") {
        lookup("location");
        route(8);
        t_on_failure("1");
        exit;
    }


    route(10);
    return;
}


# -----------------------------------------------------------------
# Handle Handle NAT
# -----------------------------------------------------------------

route[4] {
    if (is_method("INVITE") && has_totag()) {
        engage_rtp_proxy();
    }
    force_rport();
    if (1) {
        if (nat_uac_test("19")) {
            xlog("L_INFO", "NAT detected1");
            if (method == "REGISTER") {
                fix_nated_register();
            } else {
                fix_nated_contact();
                fix_nated_sdp("1");


                xlog("L_INFO", "NAT detected2");
            }
            ;
            setflag(5);
            return;
        }

    }
}

# -----------------------------------------------------------------
# Gotta Go
# -----------------------------------------------------------------

route[5] {
    if (is_method("BYE|CANCEL")) {
        unforce_rtp_proxy();
    } else
        if (is_method("INVITE")) {
            if (has_body("application/sdp"))
                rtpproxy_offer("foc");
            t_on_failure("3");
        } else
            if (is_method("ASK")) {
                if (has_body("application/sdp"))
                    rtpproxy_answer("foc");
                t_on_failure("3");
            }
    t_on_reply("3");
}

# -----------------------------------------------------------------
# Handle Handle NAT
# -----------------------------------------------------------------
route[6] {
    if (subst_uri('/(sip:.*);nat=yes/\1/')) {
        setbflag(0);
    }
    xlog("L_INFO", "NAT detected");
    if (isflagset(5) || isbflagset(0)) {
        route(5);
        if (!t_relay()) {
            sl_reply_error();
        }
    }
}

# -----------------------------------------------------------------
# Gotta Go
# -----------------------------------------------------------------
route[7] {
    if (is_method("BYE|CANCEL")) {
        unforce_rtp_proxy();
        drop();
    } else
        if (is_method("INVITE")) {
            if (has_body("application/sdp"))
                rtpproxy_offer("foc");
            t_on_failure("3");
        } else
            if (is_method("ASK")) {
                if (has_body("application/sdp"))
                    rtpproxy_answer("foc");
                t_on_failure("3");
            }
    t_on_reply("3");
    exit;
}

route[8] {
    # -----------------------------------------------------------------
    # Extenstion Calls
    # -----------------------------------------------------------------
    force_rport();
    #fix_nated_contact();

    if (has_body("application/sdp")) {
        rtpproxy_offer("foc");
        xlog("L_INFO", "NAT detected");
        t_on_failure("3");
    } else
        if (is_method("ASK")) {
            if (has_body("application/sdp"))
                fix_nated_sdp("1"); # Add direction=active to SDP
            rtpproxy_answer("foc");
            xlog("L_INFO", "NAT detected");

        }
    t_on_reply("3");

    if (!t_relay()) {
        sl_reply_error();

        # Error detection
        route(13);
        xlog("L_INFO", "Sent out From OPenSips");

        exit;
    }

}


# -----------------------------------------------------------------
# Media Start
# -----------------------------------------------------------------


route[9] {


    setflag(4);
    force_rport();
    force_tcp_alias();
    rtpproxy_answer();


    return;


}


# -----------------------------------------------------------------
# Load Balance  -detect resources
# -----------------------------------------------------------------


route[10] {


    load_balance("1", "pstn");

    route(11);


    return;
}


# -----------------------------------------------------------------
# Load Balance  - Send It out
# -----------------------------------------------------------------


route[11] {

    # LB function returns negative if no suitable destination (for requested resources) is found,
    # or if all destinations are full
    if ($retcode < 0) {
        sl_send_reply("500", "Service full");
        exit;
    }
    xlog("Selected Load Balance destination is: $du\n");

    # send it out
    route(4);

    if (!t_relay()) {
        sl_reply_error();
        # ERROR detection
        route(13);
    }
    return;
}

route[13] {

# -----------------------------------------------------------------
# Debuging info
# -----------------------------------------------------------------
return;
}


# -----------------------------------------------------------------
# Handle Handle NAT
# -----------------------------------------------------------------


branch_route[2] {
    xlog("L_INFO: new branch at $ru\n");
}

# -----------------------------------------------------------------
# Handle Handle NAT
# -----------------------------------------------------------------

onreply_route[2] {
    xlog("L_INFO: incoming reply\n");
    force_rport();
    if (status =~ "(183)|(2[0-9][0-9][0-9])" && has_body("application/sdp")) {
        if (nat_uac_test("19")) {
            log("L_INFO: Hem detectat NAT");
            setbflag(2); # flag for NAT
            # fix_nated_contact();
            fix_nated_sdp("11");
            rtpproxy_answer();

        }
       
    }
    ;
}

onreply_route[3] {
    #    sip_trace();
    if ((isflagset(5) || isbflagset(0)) && status =~ "(183)|(2[0-9][0-9][0-9])" && has_body("application/sdp")) {
        rtpproxy_answer();
    }
    if (!subst_uri('/(sip:.*);nat=yes/\1/')) {
        search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
    }
    if (isbflagset(0)) {
        #fix_nated_contact();
    }
    exit;
}


failure_route[1] {
    if (t_was_cancelled()) {
        exit;
    }

    # if the failure code is "408 - timeout" or "486 - busy",
    # forward the calls to voicemail recording
    if (t_check_status("486|408")) {
        # ASTERISK HOOK - BEGIN
        # First revert the RURI to get the original user in RURI
        # Then add the VM recording prefix to the RURI
        # forward to the call to Asterisk (replace below with real IP and port)
        load_balance("1", "vm");
        prefix("*");
        rewritehostport("default");
        route(11);

        # ASTERISK HOOK - END
        exit;
    }
}


failure_route[3] {
    #    sip_trace();
    if (isbflagset(0) || isflagset(5)) {
        unforce_rtp_proxy();
    }
}

----------------------------------------------------------------------------------------------------------------------------------------------------











Iñaki Baz Castillo wrote:
El día 23 de marzo de 2012 15:40, magnusadilsom@gmail.com
<magnusadilsom@gmail.com> escribió:
ERROR:nathelper:fix_nated_contact_f: SCRIPT BUG - second attempt to change
URI Contact
Revisa tu script, estás llamando dos veces a la función fix_nated_contact().