Hi there everyone, I need help here. This is my ser.cfg file. Now i can use SJphone call to SJphone.
However, when i try to call from SJphone to my PSTN no, it is connected but i'm facing problem to hear the voice from the receiver.
Receiver also cant hear my voice. Is there anyone there who can give me a help. Thanks for everything.
 
Regards,
 
Lee
 
#
# $Id: nathelper.cfg,v 1.1.2.1 2003/11/24 14:47:18 janakj Exp $
#
# simple quick-start config script including nathelper support
 
# This default script includes nathelper support. To make it work
# you will also have to install Maxim's RTP proxy. The proxy is enforced
# if one of the parties is behind a NAT.
#
# If you have an endpoing in the public internet which is known to
# support symmetric RTP (Cisco PSTN gateway or voicemail, for example),
# then you don't have to force RTP proxy. If you don't want to enforce
# RTP proxy for some destinations than simply use t_relay() instead of
# route(1)
#
# Sections marked with !! Nathelper contain modifications for nathelper
#
# NOTE !! This config is EXPERIMENTAL !
#
# ----------- global configuration parameters ------------------------
 
debug=7         # debug level (cmd line: -dddddddddd)
fork=yes
port=5060
log_stderror=yes        # (cmd line: -E)
fifo="/tmp/ser_fifo"
#memlog=3
 
# Uncomment these lines to enter debugging mode
/*
debug=3
fork=yes
port=5060
log_stderror=yes
*/
 
#check_via=no   # (cmd. line: -v)
#dns=no           # (cmd. line: -r)
#rev_dns=no      # (cmd. line: -R)
#children=4
#fifo="/tmp/ser_fifo"
#alias="sipproxy.com"
# ------------------ module loading ----------------------------------
 
# Uncomment this if you want to use SQL database
loadmodule "/usr/local/lib/ser/modules/acc.so"
#loadmodule "/usr/local/lib/ser/modules/mysql.so"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/print.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.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"
loadmodule "/usr/local/lib/ser/modules/textops.so"
loadmodule "/usr/local/lib/ser/modules/exec.so"
#loadmodule "/usr/local/lib/ser/modules/group.so"
loadmodule "/usr/local/lib/ser/modules/group_radius.so"
#loadmodule "/usr/local/lib/ser/modules/uri.so"
#loadmodule "/usr/local/lib/ser/modules/uri_db.so"
loadmodule "/usr/local/lib/ser/modules/uri_radius.so"
#loadmodule "/usr/local/lib/ser/modules/domain.so"
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_radius.so"
#loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/xlog.so"
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
#loadmodule "/usr/local/lib/ser/modules/option.so"
#loadmodule "/usr/local/lib/ser/modules/speeddial.so"
 
# ----------------- setting module-specific parameters ---------------
 
#modparam("acc|auth_db|group|uri_db|usrloc", "db_url", "mysql://root:mysqldb04@localhost/ser")
#modparam("usrloc", "db_url", "mysql://root:mysqldb04@localhost/ser")
#---------------------------- use_domain setting
#modparam("auth_db|group|uri_db|usrloc", "use_domain", 1)
#---------------------------- usrloc params
#modparam("usrloc", "db_mode",   0)
# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)
#modparam("usrloc", "timer_interval", 60)
#modparam("usrloc", "desc_time_order", 1)
 
#----------------------------  auth params
modparam("auth_radius", "radius_config", "/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("auth_radius", "service_type", 15)
modparam("group_radius", "radius_config", "/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("group_radius", "use_domain", 1)
#modparam("auth_db", "user_column", "user_id")
#modparam("auth_db", "calculate_ha1", yes)
#modparam("auth_db", "password_column", "password")
 
modparam("uri_radius", "radius_config", "/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("uri_radius", "service_type", 11)
#-----------------------------accounting params
modparam("acc", "log_level", 1)
modparam("acc", "radius_flag", 1)
modparam("acc", "failed_transactions", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
modparam("acc", "radius_config", "/usr/local/etc/radiusclient-ng/radiusclient.conf")
#modparam("acc", "db_url", "mysql://ser:elanetw123@localhost/ser")
#modparam("acc", "radius_log_flag", 1)
modparam("acc", "radius_missed_flag", 2)
 
#----------------------------- tm params
modparam("tm", "fr_timer", 12)
modparam("tm", "fr_inv_timer", 24)
 
#-----------------------------  rr params
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_double_rr", 0)
modparam("rr", "enable_full_lr", 1)
 
#----------------------------- registrar params
#modparam("registrar", "nat_flag", 6)
#modparam("registrar", "min_expires", 60)
#modparam("registrar", "max_expires", 86400)
#modparam("registrar", "default_expires", 3600)
#modparam("registrar", "desc_time_order", 1)
#modparam("registrar", "append_branches", 1)
#modparam("registrar", "use_domain", 1)
 
#----------------------------- nathelper params
modparam("nathelper", "natping_interval", 10) # Ping interval 30 s
modparam("nathelper", "ping_nated_only", 1)   # Ping only clients behind NAT
 
#----------------------------- exec params
modparam("exec", "setvars", 1)
modparam("exec", "time_to_kill", 10)
 
#----------------------------- domain params
#modparam("domain", "db_mode", 1)
 
#----------------------------- Xlog params
modparam("xlog", "buf_size", 8192)
# -------------------------  request routing logic -------------------
 
# main routing logic
 
route{
 
        # ------------------------------------------------------------
        # Sanity checks -- messages
        # ------------------------------------------------------------
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                break;
        };
        if (msg:len >=  max_len ) {
                sl_send_reply("513", "Message Overflow");
                break;
        };
 

        # ------------------------------------------------------------
        # Option Section
        # ------------------------------------------------------------
        #if (search("^From: sip:sipsak@") &&
        #       (method=="OPTIONS") && (!uri=~:"sip:.*[@]+.*")) {
        #               option_reply();
        #               break;
        #};
        if (loose_route()) {t_relay(); break;};
 

        if (method=="BYE" || method=="CANCEL" || method=="INVITE") {
                setflag(1);
                log(1, "Accounting Flag ON\n");
        };
 
        if (method=="INVITE") {
                setflag(2);
                log(1, "Missed Call Flag ON\n");
        };
 

        # !! Nathelper
        # -----------------------------------------------------------
        # NAT test Section
        # -----------------------------------------------------------
        if (nat_uac_test("3")) {
                if (method == "REGISTER" ||(!search("^Record-Route:"))) {
                                log("LOG: Someone trying to register from private IP, rewriting\n");
                    fix_nated_contact(); # Rewrite contact with source IP of signalling
 
                  #     if (method == "REGISTER") {
                #               fix_nated_register();
                #       } else
                         if (method=="INVITE") {
                                fix_nated_sdp("1"); # Add direction=active to SDP
                        };
                    force_rport(); # Add rport parameter to topmost Via
                    setflag(6);    # Mark as NATed
                };
        };
 
        if (!method=="REGISTER") record_route();
        if (loose_route()) {
                # mark routing logic in request
                append_hf("P-hint: rr-enforced\r\n");
                route(1);
                break;
        };
 
        if (uri=~"^sip:101*") {
               rewritehost("202.xxx.xx.xxx:5060");
        #       t_relay_to_udp("202.xxx.xx.xxx", "5060");
               forward(uri:host, uri:port);
        #        append_hf("p-hint:PSTN call\r\n");
        #        route(1);
                break;
        };
 
        if (!uri==myself) {
                # mark routing logic in request
                append_hf("P-hint: outbound\r\n");
                route(1);
                break;
        };
 
 
 
        if (uri==myself) {
                if (method=="REGISTER") {
        #       log(1, "REGISTER: Authenticating user\n");
                        if (!radius_proxy_authorize("")) {
                #       log(1, "REGISTER: challenging user\n");
                                proxy_challenge("", "1");
                                break;
                        };
                        save("location");
                        break;
                };
 
 
 
        #if (method=="INVITE") {
        #       log(1, "INVITE\n");
        #       setflag(1);
                #rad_acc_request("Start");
        #};
        #if (method=="MESSAGE") {
        #       log(1, "MESSAGE\n");
        #setflag(1);
        #};
 
        #if (method=="BYE" || method=="CANCEL") {
        #       log (1, "BYE or CANCEL\N");
        #       setflag(1);
                #rad_acc_request("Stop");
        #};
 
        lookup("aliases");
                if (!uri==myself) {
                        append_hf("P-hint: outbound alias\r\n");
                        route(1);
                        break;
                };
 
                if (!lookup("location")) {
                        sl_send_reply("404", "Not Found");
                        break;
                };
        };
        append_hf("P-hint: usrloc applied\r\n");
        route(1);
 

}
route[1]
{
        if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" && !search("^Route:")){
            sethostport("202.xxx.xx.xxx");
            sl_send_reply("479", "We don't forward to private IP addresses");
            break;
       };
 
        # if client or server know to be behind a NAT, enable relay
        if (isflagset(6)) {
            force_rtp_proxy();
        };
 
        # NAT processing of replies; apply to all transactions (for example,
        # re-INVITEs from public to private UA are hard to identify as
        # NATed at the moment of request processing); look at replies
        t_on_reply("1");
 
        # send it out now; use stateful forwarding as it works reliably
        # even for UDP2TCP
        if (!t_relay()) {
                sl_reply_error();
        };
}
 
# !! Nathelper
onreply_route[1] {
    # NATed transaction ?
    if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
        fix_nated_contact();
        force_rtp_proxy();
    } else if (nat_uac_test("1")) {
        fix_nated_contact();
    };
}