[Serusers] Getting rid of SIP URI in Caller ID

Charles Ulrich charles at idealso.com
Tue Jul 3 22:57:22 CEST 2007


Hi all,

I'm fairly new to SER (just heard about it this afternoon), but I've 
already run up against a problem that's vexing me.

We have a Polycom phone sitting behind a Linksys WRT54G router/firewall 
with DD-WRT firmware. This version of DD-WRT is the "voip" edition, 
meaning it has SER and rtpproxy installed to help ease NAT issues with 
SIP. No configuration of SER is necessary, we enter the WRT54G's IP 
address into the phone's outbound proxy field and it just works.

The only drawback is that when using this method, the caller ID on an 
incoming call from the PSTN contains a SIP URI (in the form of 
sip:5551212 at 207.179.x.x) instead of a simple telephone number. Our 
end-users are pretty voip illiterate and thus haven't the slightest 
clue how VoIP works. They are only going to get confused when a SIP URI 
shows up on their caller ID instead of the actual PSTN phone number of 
the person who called them. How can this be remedied?

I can't tell what version of ser is on this device because the -h and -V 
flags return nothing. (Probably to make it slightly smaller for the 
embedded platform.) The 'strings' utility wasn't helpful either.

Attached is the ser.cfg that comes with DD-WRT. Any help is greatly 
appreciated. Let me know if I need to provide more information.

Thanks!

-- 
Charles Ulrich
Ideal Solution, LLC -- http://www.idealso.com
-------------- next part --------------
#
# $Id: ser.cfg,v 1.5 2005/05/21 19:40:43 lemp Exp $
#
# simple quick-start config script
#

# ----------- global configuration parameters ------------------------
#debug=3         # debug level (cmd line: -dddddddddd)
#fork=yes
#log_stderror=no        # (cmd line: -E)

/* Uncomment these lines to enter debugging mode 
debug=7
fork=no
log_stderror=yes
*/

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"

mhomed=1

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

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

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

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

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

# -- usrloc params --

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

# Uncomment this if you want to use dbtext database 
# for persistent storage and comment the previous line
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url", "/var/dbtext/ser")

# -- 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)


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

# main routing logic

route{

        # initial sanity checks -- messages with
        # max_forwards==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;
        };

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

        if (method=="REGISTER") 
        {
                if (src_ip==192.168.0.0/16 or src_ip==172.16.0.0/12 or src_ip==10.0.0.0/8)
                {       
                        if (!nat_uac_test("1")) 
                        {
                                log(1, "Dont't like that STUN thing\n");
                                break;
                        }                                     
                        if (uri==myself)
                        {
                                #wants to register only at router, no external SIP provider  
                                #log(1, "internal REGISTER\n");
                                #make entry at local registrar
                                save("location");
                        }
                        else    
                        {       
                                #wants to register at external SIP provider 
                                #log(1, "external REGISTER\n");
                                #check if user is already registered at internal registrar 
                                if (!lookup("location"))
                                {
                                        #if not do a drive-by registration
                                        #for registration at internal registrar
                                        #without a reply 
                                        save_noreply("location");       
                                };
                                #Fixing of private address in contact hf
                                fix_nated_contact("192.168.1.2"); 
                                if (!t_relay()) 
                                {
                                        sl_reply_error();
                                };
                        };
                        break;
                }
                else
                {
                        #Handling of registrations from internet
                        #Default is registrations not accepted
                        break;
                };                   
        };   

        if (src_ip==192.168.0.0/16 or src_ip==172.16.0.0/12 or src_ip==10.0.0.0/8)
        {
                if (uri==myself)
                {
                        if (!lookup("location") and !lookup("aliases")) 
                        {
                                sl_send_reply("404", "Not Found");
                                break;
                        };
                }
                else
                {
                        if (!lookup("location") and !lookup("aliases"))
                        {    
                                #log(1, "outgoing request\n");                           
                                fix_nated_contact("192.168.1.2");
                                if (method=="INVITE")
                                {
                                        setflag(5);
                                        force_rtp_proxy("FAIE");
                                        #log(1, "forcing RTP proxy IE\n");   
                                }; 
                                t_on_reply("1");
                        };        
                };                      
        }
        else
        {
                if (uri==myself)
                {
                        if (lookup("location") or lookup("aliases"))
                        {       
                                #log(1, "incoming request\n");
                                if (method=="INVITE")
                                {
                                        setflag(5);
                                        force_rtp_proxy("FAEI");
                                        #log(1, "forcing RTP proxy EI\n");   
                                };
                                t_on_reply("1");                                         
                        }
                        else
                        {
                                sl_send_reply("404", "Not Found");
                                break;
                        }; 
                };                               
        
        };
        # forward to current uri now; use stateful forwarding; that
        # works reliably even if we forward from TCP to UDP
        if (!t_relay()) {
                sl_reply_error();
        };

}


onreply_route[1]
{
        if (src_ip==192.168.0.0/16 or src_ip==172.16.0.0/12 or src_ip==10.0.0.0/8)
        {
                #log(1, "outgoing reply\n");
                fix_nated_contact("192.168.1.2");
                if (isflagset(5) && status =~ "(183)|2[0-9][0-9]")
                {
                        force_rtp_proxy("FAIE");
                };
        }
        else
        {
                #log(1, "incoming reply\n");
                if (isflagset(5) && status =~ "(183)|2[0-9][0-9]")
                {                
                        force_rtp_proxy("FAEI");
                };
        };
}



More information about the sr-users mailing list