[Serusers] caller=callee, Not giving me Busy

ram talk2ram at gmail.com
Wed Aug 30 14:59:54 CEST 2006


 Hi

iam using old SER 0.814, since its deployed already in my Office
we are in process of migrationg to openser soon
mean time i need to fix some problems with existing server only
that is the reason iam trying to modify the code and achive the
following things

1. Voice mail
2. Caller =callee
3. if the user not in voicemail group ( get busy), if the user off  line,
Not found

I have modified some code after reading all news group
here iam attaching the config file which iam trying

iam also getting the some errors in Log

Aug 30 17:58:20 router ser[609]: ERROR: sl_reply_error used: I'm terribly
sorry, server error occured (1/SL)
Aug 30 17:58:27 router ser[604]: ERROR: sl_reply_error used: I'm terribly
sorry, server error occured (1/SL)
Aug 30 18:00:05 router ser[1564]: ERROR: tcp_init: bind(6, 0x80bd7c0, 16) on
127.0.0.1: Address already in use
Aug 30 18:00:06 router ser[1571]: ERROR: tcp_init: bind(6, 0x80bd7c0, 16) on
127.0.0.1: Address already in use


iam running a cron job to check the services

#!/bin/sh
mysqlcheck --password=cdrouter --auto-repair --all-databases
sleep 4
ser
sleep 4
chmod 777 /tmp/ser_fifo



help will be appriciated

Ram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20060830/c03718ff/attachment.htm>
-------------- next part --------------
# ----------- global configuration parameters ------------------------

debug=3            # debug level (cmd line: -dddddddddd)
#log_facility=LOG_LOCAL7
fork=yes
log_stderror=no    # (cmd line: -E)

/* Uncomment these lines to enter debugging mode
debug=7            # debug level (cmd line: -dddddddddd)
fork=no
log_stderror=yes
*/

#debug=3
check_via=no    # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
#port=5060
#children=4
fifo="/tmp/ser_fifo"

alias="mydomain.com"


# blind test ?
#syn_branch=no


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

# Uncomment this if you want to use SQL database
loadmodule "/usr/local/lib/ser/modules/mysql.so"

loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/vm.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/acc.so"
loadmodule "/usr/local/lib/ser/modules/msilo.so"
loadmodule "/usr/local/lib/ser/modules/domain.so"
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
loadmodule "/usr/local/lib/ser/modules/group.so"

# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"

# answering machine
loadmodule "/usr/local/lib/ser/modules/xlog.so"


# ----------------- setting module-specific parameters ---------------


# --domain module--
modparam("usrloc", "db_url", "mysql://ser:heslo@localhost/ser")
modparam("domain", "db_mode", 1)
modparam("domain", "domain_table", "domain")
modparam("domain", "domain_col", "domain")

# --vm params--
modparam("voicemail", "db_url", "mysql://ser:heslo@localhost/ser")

# --group authorization
modparam("group", "db_url", "mysql://ser:heslo@localhost/ser")
modparam("group", "table", "grp")
modparam("group", "user_column", "username")
modparam("group", "group_column", "grp")

# --acc params--
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
modparam("acc", "log_fmt", "fimos")
modparam("acc", "db_url", "mysql://ser:heslo@localhost/ser")
modparam("acc", "db_missed_flag", 2)
modparam("acc", "db_flag", 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)

# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
modparam("auth_db", "password_column", "password")

# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

modparam("tm", "fr_timer", 10)
modparam("tm", "fr_inv_timer", 35)
modparam("tm", "wt_timer", 1)

# -------------------------  request routing logic -------------------
route {

if(method=="INVITE" || method=="BYE")
                setflag(1);

        if (!mf_process_maxfwd_header("10")) {
                log("LOG: Too many hops\n");
 sl_send_reply("483", "Alas Too Many Hops");
                break;
        };
        if ( msg:len > max_len ) {
                sl_send_reply("513", "Message too big");
                break;
        };

        record_route();
        if (loose_route()) {
                t_relay();
                break;
        };


        if (!uri==myself) {
                t_relay();
                break;
        };

        if (uri==myself | uri=~"^sip:.*@mydomain.com" | uri=~"^sip:.*@202.63.111.18" ) {
        if (method == "REGISTER") {
                        if (!www_authorize("", "subscriber")) {
                                www_challenge("", "0");
                                break;
                        };
                        save("aliases");
                        save("location");
                        sl_reply_error();

                };

 if(uri=~"^sip:999@(mydomain\.com|XXX\.XXX\.XXX\.XX)"){
                        #log(1,"411/911 expression match");
                        log(1,"asterisk voice dial4 match");
                        route(3);
                        break;
                };
if (uri=~"^sip:0091[0-9].*@.*") {
                       sl_send_reply("500", "prefix 522 blocked");
  break;
                };

        if (uri=~"^sip:01191[0-9].*@.*") {
                       sl_send_reply("500", "prefix 522 blocked");
                       break;
                };


if (uri=~"^sip:1[0-9].*@.*" | uri=~"^sip:01[0-9].*@.*") {
               if (!is_user_in("From", "ld")) {
                       sl_send_reply("403", "Payment required");
                       break;
                };
                setflag(1);
                rewritehostport("Provider ip:5060");
                if (!t_relay()) {
                        sl_reply_error();
                };
                break;
        };
        };

        if (is_user_in("Request-URI", "voicemail")) {
                setflag(4);
        };

        # native SIP destinations are handled using our USRLOC DB
        if (!lookup("location")) {
                # handle user which was not found
                route(4);
                break;
        };

        # if user is on-line and is in voicemail group, enable redirection
        if (method == "INVITE"  || method=="BYE" || method=="ACK" && isflagset(4)) {
 setflag(1);
                t_on_failure("1");
        };
        t_relay();
}


# ------------- handling of unavailable user ------------------

route[3]{
        log(1,"route[3]:no user location: foward to voicemail");
        rewritehostport("myvoicemailserverip:5090");
        t_relay();
}


route[4] {

        # non-Voip -- just send "off-line"
        if (!(method == "INVITE" || method == "ACK" || method == "CANCEL")) {
                sl_send_reply("404", "Not Found");
                break;
        };

        # not voicemail subscriber
        if (!isflagset(4)) {
                sl_send_reply("404", "Not Found and no voicemail turned on");
                break;
        };

        # forward to voicemail now
        rewritehostport("myvoicemailserverip:5090");
   t_relay_to_udp("myvoicemailserverip", "5090");
}

# if forwarding downstream did not succeed, try voicemail running

failure_route[1] {
        revert_uri();
        rewritehostport("myvoicemailserverip:5090");
        append_branch();
        t_relay_to_udp("myvoicemailserverip", "5090");
}



More information about the sr-users mailing list