[Serusers] Using RTPPROXY to translate between IPv4 and IPv6.

Achim Marikar info at marikar.com
Wed Jan 26 16:37:40 CET 2005


Hello,

I just started using SER. Using SER with the standard ser.cfg was easy,
just configuring SER with rtpproxy isn't.

I'd like to force all clients to use the rtpproxy (clients: Cisco7960,
Kphone 3.11 IPv6, and Kphone 4.0.5.).

The server is a Debian Sarge pc with ser 0.8.14 (debian-packages from
iptel.org) with mysql4, php4, apache2 and the cvs-version of rtpproxy. 

I found a good manual here:
http://www.id.ethz.ch/people/allid_list/armin/SIP-IPv4-IPv6.pdf
But the clients are still using P2P (if ipv4 <-> ipv4 or ipv6 <-> ipv6,
ipv4 <-> ipv6 isn't possible).

Using ethereal I can see that ser is still sending the (calling-)client
the ip-address of the (called-)client, instead of the ip-address of the
proxy:

<sip:phil at 139.6.16.83;ftag=000d290ab5b300495ac945a4-569189e1;lr=on>
    Message body
        Session Description Protocol
            Session Description Protocol Version (v): 0
            Owner/Creator, Session Id (o): username 0 0 IN IP4
139.6.16.73
            Session Name (s): The Funky Flow
            Connection Information (c): IN IP4 139.6.16.73
                Connection Network Type: IN
                Connection Address Type: IP4
                Connection Address: 139.6.16.73
            Time Description, active time (t): 0 0
            Media Description, name and address (m): audio 32778 RTP/AVP
0 
            Media Attribute (a): rtpmap:0 PCMU/8000

What is wrong in my configuration?

I am starting the proxy with /usr/local/bin/rtpproxy -l /139.6.16.83 -6
3000:0:0:12::30 
(we are using faked ipv6-adresses, we are not connected to the
(ipv6-)internet)


My ser.cfg:

# 
 # $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei 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=2 
 fifo="/tmp/ser_fifo" 
 
 listen=139.6.16.83 
 listen=3000:0:0:12::30 
 
 # ------------------ module loading ---------------------------------- 
 
 # Uncomment this if you want to use SQL database 
 loadmodule "/usr/lib/ser/modules/mysql.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" 
 
 # Uncomment this if you want digest authentication 
 # mysql.so must be loaded ! 
 loadmodule "/usr/lib/ser/modules/auth.so" 
 loadmodule "/usr/lib/ser/modules/auth_db.so" 
 
 # NAT-Traversal usw 
 loadmodule "/usr/lib/ser/modules/nathelper.so" 
 
 # ----------------- setting module-specific parameters --------------- 
 
 # -- 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) 
 
 # -------- Parameter des Nathelper - Moduls -------- 
 
 modparam("nathelper", "rtpproxy_sock", "/var/run/rtpproxy.sock") 
 
 # -------------------------  request routing logic ------------------- 
 
 # me, myself & I: 
 alias="139.6.16.83" 
 alias="3000:0:0:12::30" 
 alias="ipv6sipserv.nt.fh-koeln.de" 
 alias="ipv6sipserv.ipv6.fh-koeln.de" 
 alias="ipv6sipserver.ipv6.fh-koeln.de" 
 alias="sipserver.ipv6.fh-koeln.de" 
 alias="sipserver" 
 alias="ipv6sipserv" 
 
 # main routing logic 
 
 route { 
         # initial sanity checks -- messages with 
         # max_forwars == 0, or excessively long requests, 
         # or those that don't addressed to us 
         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; 
         }; 
 
         # route invitation request to other domains 
         if (!(uri == myself) && method == "INVITE") { 
                 record_route(); 
                 if (!t_relay()) 
                         sl_reply_error(); 
                 break; 
         }; 
         if (method == "REGISTER") { 
                 if (af == inet) { 
                         save("location_inet4"); 
                 } else if (af == inet6) { 
                         save("location_inet6"); 
                 } else { 
                         sl_send_reply("403", "Anmeldung
fehlgeschlagen!"); 
                 }; 
                 break; 
         }; 
 
         if (method == "INVITE") { 
                 ################################ 
                 ### CASE: Anrufer nutzt IPv4 ### 
                 ################################ 
                 if (lookup("location_inet4")) { 
 
                 # Comment out three lines below if you want 
                 # RTP for IPv4->IPv4 calls to go directly 
                 # between UAs 
 
                 ###### 
                 ### CASE: Beide nutzen IPv4 
                 ###### 
                 if (af == inet) 
                         if (force_rtp_proxy("FAII")) 
                                 t_on_reply("1"); 
 
                 # proxy session from a Internal IPv4 
                 # phone to a External IPv6 address 
 
                 ###### 
                 ### CASE: Anrufer nutzt IPv4, Anzurufender IPv6 
                 ###### 
                 if (af == inet6) 
                         if (force_rtp_proxy("FAIE")) 
                                 t_on_reply("1"); 
                 } 
 
                 ################################ 
                 ### CASE: Anrufer nutzt IPv6 ### 
                 ################################ 
                 else if (lookup("location_inet6")) { 
 
                 # proxy session from a External IPv6 
                 # phone to a Internal IPv4 address 
 
                 ###### 
                 ### CASE: Anrufer nutzt IPv6, Anzurufender IPv4 
                 ###### 
                 if (af == inet) 
                         if (force_rtp_proxy("FAEI")) 
                                 t_on_reply("1"); 
 
                 # Comment out three lines below if you want 
                 # RTP for IPv6->IPv6 calls to go directly 
                 # between UAs 
 
                 ###### 
                 ### CASE: Beide nutzen IPv6 
                 ###### 
                 if (af == inet6) 
                         if (force_rtp_proxy("FAEE")) 
                                 t_on_reply("1"); 
                 } 
 
                 else { 
                         sl_send_reply("403", "User nicht erreichbar
oder unbekannt!"); 
                         break; 
                 }; 
         }; 
 
         if (method == "BYE" || method == "CANCEL") 
                 unforce_rtp_proxy(); 
 
         # Do strict routing if pre-loaded route headers present 
         if (loose_route()) { 
         t_relay(); 
         break; 
         }; 
 
         if (method == "INVITE") 
         record_route(); 
 
         if (!t_relay()) 
         sl_reply_error(); 
 } 
 
 onreply_route[1] { 
         if (!(status=~"183" || status=~"200")) 
                 break; 
         force_rtp_proxy("FA"); 
 }

Sorry for my bad english. Thanks for your help!
-- 
Achim Marikar <info at marikar.com>




More information about the sr-users mailing list