Hi everyone,
I just would like to clarify that the versions of nathelper and
rtpproxy that I am running together are compatible.
localhost:/ grep Id: rtpproxy/main.c
* Id: main.c,v 1.21 2004/08/13 19:04:23 sobomax Exp$
localhost:/ head -1 sip_router/modules/nathelper/nathelper.c
* Id: nathelper.c,v 1.77 2005/02/15 18:50:56 sobomax Exp$
Could someone confirm if the above work successfully together? I am
running ser 0.8.14.
Thanks,
Aisling.
-------------------Legal Disclaimer---------------------------------------
The above electronic mail transmission is confidential and intended only for the person to whom it is addressed. Its contents may be protected by legal and/or professional privilege. Should it be received by you in error please contact the sender at the above quoted email address. Any unauthorised form of reproduction of this message is strictly prohibited. The Institute does not guarantee the security of any information electronically transmitted and is not liable if the information contained in this communication is not a proper and complete record of the message as transmitted by the sender nor for any delay in its receipt.
Yep.
If you have configured nathelper to communicate with rtpproxy using udp,
you can use tcpdump port 22222 (which is the default communication port, I
believe)
Also, rtpproxy can be started with -f option (no-fork)
g-)
Aisling O'Driscoll wrote:
> Hi Greger,
>
> Thanks for the advice. If I run "netstat -tunap" should I see
> rtpproxy with a PID and state listening?? How do I use tcpdump i.e.
> what ports am I monitoring?
>
> RTPProxy is installed and I have provisions were made for it in my
> original ser.cfg. However there still seems to be no success. I am
> having my doubts about whether rtpproxy is actually functioning at
> all.
>
> Thank you,
> Aisling.
>
>
>
> ---- Original Message ----
> From: greger(a)teigre.com
> To: ashling.odriscoll(a)cit.ie
> Subject: Re: [Serusers] SER SDP Port Problem??
> Date: Mon, 21 Feb 2005 16:51:16 +0100
>
>> If you have the latest cvs version, you can use "19" (add test=16).
>> It may
>> make a difference if you have configured your UA with stun. If not,
>> "3"
>> should be good.
>> Use some sort of stun client implementation to test your nat.
>> http://sourceforge.net/project/showfiles.php?group_id=47735&package_i
>> d=102146
>>
>> rtpproxy is rather silent. :-( You should do a tcpdump port
>> control_port to
>> see if any traffic is going.
>> Also, you can do netstat -nlp to see if any udp ports are allocated
>> once you
>> believe a call is proxied.
>> g-)
>>
>> Aisling O'Driscoll wrote:
>>> Hi Greger,
>>>
>>> I only use nat_uac_test("3") as that is what is given in most
>>> examples on the mailing list. Is there any way that i can test if I
>>> am behind symmetric nat? I have rtpproxy running with ser but not
>>> sure if my below ser.cfg script invokes it correctly. Do you know
>>> where I could find the rtpproxy debug log?
>>>
>>> Thanks again,
>>> Aisling.
>>>
>>> ---- Original Message ----
>>> From: greger(a)teigre.com
>>> To: ashling.odriscoll(a)cit.ie, serusers(a)lists.iptel.org
>>> Subject: Re: [Serusers] SER SDP Port Problem??
>>> Date: Mon, 21 Feb 2005 12:11:15 +0100
>>>
>>>> Aisling,
>>>> The port is in the m= line. You use nat_uac_test("3"). Any
>> particular
>>>> reason
>>>> for not using all tests?
>>>> Please note that sdp rewriting does not work if the UA is behind a
>>>> symmetric
>>>> NAT and you are calling in. You must then via an RTP proxy like
>>>> mediaproxy
>>>> or rtpproxy.
>>>> g-)
>>>>
>>>> Aisling O'Driscoll wrote:
>>>>> Hi,
>>>>>
>>>>> I understand the basic problem behind one way audio is that the
>>>>> client behind nat has a private address in the sdp information,
>>>>> therefore the voice cannot be delivered to this private address.
>> It
>>>>> is necessary to rewrite this sdp info with the nat public
>> address.
>>>>> However I have done this in my ser.cfg and I still have one way
>>>>> voice.
>>>>>
>>>>> I have included some of relevant ethereal messages on SER and my
>>>>> ser.cfg below. The messages show that the rtp information has
>> been
>>>>> changed. Does anyone think the problem is because there is no
>> port
>>>>> information in the "c" and "o" fields in the sdp?? If so how can
>> I
>>>>> make sure the port is included?
>>>>>
>>>>> Many Thanks,
>>>>> Aisling.
>>>>>
>>>>> Ethereal messages:
>>>>>
>>>>> call between private client with public nat address 63.218.54.71
>>>> and
>>>>> a public client with address 157.190.183.80. The SER address is
>>>>> 157.190.183.70.
>>>>>
>>>>> REGISTER sip:157.190.183.70 SIP/2.0
>>>>> VIA: SIP/2.0/UDP 63.218.54.71:11987;rport;branch=z9h.....
>>>>> FROM: whoever <sip:2008@157.190.183.70>;tag=455....
>>>>> TO: whoever <sip:2008@157.190.183.70>
>>>>> CONTACT: "whoever" <sip:2008@63.218.54.71:11987>
>>>>> Call-Id: ....
>>>>> CSeq: 22227 REGISTER
>>>>> Expires; 1800
>>>>> User Agent: X-Lite release 1103m
>>>>> Content-Length: 0
>>>>>
>>>>> SIP/2.0 200 OK
>>>>> VIA: SIP/2.0/UDP 63.218.54.71:11987;rport;branch=z9h.....
>>>>> FROM: whoever <sip:2008@157.190.183.70>;tag=455....
>>>>> TO: whoever <sip:2008@157.190.183.70>
>>>>> CONTACT: "whoever" <sip:2008@63.218.54.71:11987>;q=0.00
>>>> expires=1800
>>>>> Call-Id: ....
>>>>> CSeq: 22227 REGISTER
>>>>> Expires; 1800
>>>>> User Agent: X-Lite release 1103m
>>>>> Content-Length: 0
>>>>>
>>>>> The public client (157.190.183.80 also registers)
>>>>>
>>>>> Then the private client invites the public client to a voice
>>>>> conversation:
>>>>>
>>>>> INVITE sip:2001@157.190.183.70 SIP/2.0
>>>>> VIA: SIP/2.0/UDP 63.218.54.71:11987;rport;branch=z9h.....
>>>>> FROM: whoever <sip:2008@157.190.183.70>;tag=455....
>>>>> TO: whoever <sip:2001@157.190.183.70>
>>>>> CONTACT: "whoever" <sip:2008@63.218.54.71:11987>
>>>>> Call-Id: ....
>>>>> CSeq: 19929 INVITE
>>>>> Expires; 1800
>>>>> User Agent: X-Lite release 1103m
>>>>> Content-Type=application/sdp
>>>>> Content-Length: 290
>>>>>
>>>>> Session description Protocol
>>>>> Owner/Creator of the Session (o): 2008 245812 272828 IN IP4
>>>>> 63.218.54.71
>>>>> Connection information (c): IN IP4 63.218.54.71
>>>>>
>>>>> A 100 Trying is sent back from SER to the private client (i.e.
>>>> caller)
>>>>>
>>>>> The INVITE is forwarded from SER to public client (callee) as
>> show
>>>>> below:
>>>>>
>>>>> INVITE sip:2001@157.190.183.70 SIP/2.0
>>>>> VIA: SIP/2.0/UDP 157.190.183.70;branch=....
>>>>> VIA: SIP/2.0/UDP 63.218.54.71:11987;branch=z9h.....
>>>>> FROM: whoever <sip:2008@157.190.183.70>;tag=455....
>>>>> TO: whoever <sip:2001@157.190.183.70>
>>>>> CONTACT: "whoever" <sip:2008@63.218.54.71:11987>
>>>>> Call-Id: ....
>>>>> CSeq: 19929 INVITE
>>>>> Expires; 1800
>>>>> User Agent: X-Lite release 1103m
>>>>> Content-Type=application/sdp
>>>>> Content-Length: 290
>>>>>
>>>>> Session description Protocol
>>>>> Owner/Creator of the Session (o): 2008 245812 272828 IN IP4
>>>>> 63.218.54.71
>>>>> Connection information (c): IN IP4 63.218.54.71
>>>>>
>>>>> 157.190.183.80 157.190.183.70 SIP 100 Trying
>>>>> 157.190.183.80 157.190.183.70 SIP 180 Ringing
>>>>> 157.190.183.70 63.218.54.71 SIP 180 Ringing
>>>>>
>>>>> 157.190.183.80 157.190.183.70 SIP/SDP Status: 200OK
>>>>>
>>>>> SIP/2.0 200 OK
>>>>> Via: SIP/2.0/UDP 157.190.183.70;branch=....
>>>>> Via: SIP/2.0/UDP 63.218.54.71:11987;rport=11987;branch=.....
>>>>> From: whoever<sip:2008@157.190.183.70>;tag=...
>>>>> To: <sip:2001@157.190.183.70>;tag=....
>>>>> CSeq: 19929 INVITE
>>>>> User Agent: Grandtsream BT100 1.0.5.18
>>>>> Contact: <sip:2001@157.190.183.80>
>>>>>
>>>>> Session description protocol
>>>>> (c) IN IP4 157.190.183.80
>>>>>
>>>>>
>>>>> #
>>>>> # $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=4
>>>>> fifo="/tmp/ser_fifo"
>>>>>
>>>>> alias="157.190.183.70:5060"
>>>>>
>>>>> # ------------------ 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"
>>>>> loadmodule "/usr/lib/ser/modules/textops.so"
>>>>> loadmodule "/usr/lib/ser/modules/nathelper.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"
>>>>>
>>>>> # ----------------- 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
>>>>> #NB Had to up this value from 1 to 11 because reinvites were
>>>>> bombarding called phone
>>>>> modparam("rr", "enable_full_lr", 11)
>>>>>
>>>>> #!! Nathelper
>>>>> modparam("registrar", "nat_flag", 6)
>>>>> modparam("nathelper", "natping_interval", 30) #Ping interval 30 s
>>>>> modparam("nathelper", "ping_nated_only", 1) #Ping only clients
>>>>> behind NAT
>>>>>
>>>>> modparam("tm", "fr_inv_timer", 80)
>>>>>
>>>>> # ------------------------- 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;
>>>>> };
>>>>>
>>>>> #########################added for cit client behind nat
>>>>> 09/02/05#######################
>>>>> 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
>>>>> 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
>>>>> };
>>>>> };
>>>>>
>>>>
>> #####################################################################
>>>>> ###################
>>>>>
>>>>> # we record-route all messages -- to make sure that
>>>>> # subsequent messages will go through our proxy; that's
>>>>> # particularly good if upstream and downstream entities
>>>>> # use different transport protocol
>>>>>
>>>>> if (method =="REGISTER") record_route();
>>>>>
>>>>> # loose-route processing
>>>>> if (loose_route()) {
>>>>> #commented 11/02/05
>>>>> #t_relay();
>>>>> route(1);
>>>>> break;
>>>>> };
>>>>>
>>>>> # if the request is for other domain use UsrLoc
>>>>> # (in case, it does not work, use the following command
>>>>> # with proper names and addresses in it)
>>>>> if (uri==myself) {
>>>>>
>>>>> log(1,"into loop");
>>>>> if (method=="REGISTER") {
>>>>>
>>>>> # Uncomment this if you want to use digest authentication
>>>>> # if (!www_authorize("157.190.183.70", "subscriber")) {
>>>>> # www_challenge("157.190.183.70", "0");
>>>>> # break;
>>>>> # };
>>>>>
>>>>> save("location");
>>>>> break;
>>>>> };
>>>>>
>>>>> lookup("aliases");
>>>>> if (!uri==myself) {
>>>>> append_hf("P-hint: outbound alias\r\n");
>>>>> route(1);
>>>>> break;
>>>>> };
>>>>>
>>>>> if (method=="INVITE"){
>>>>> log(1,"in invite loop");
>>>>> #break; #no 100 trying
>>>>> t_on_failure("1");
>>>>> };
>>>>>
>>>>> # native SIP destinations are handled using our USRLOC DB
>>>>> if (!lookup("location")) {
>>>>> #sl_send_reply("404", "Not Found");
>>>>> route(2);
>>>>> break;
>>>>> };
>>>>> };
>>>>>
>>>>> # forward to current uri now; use stateful forwarding; that
>>>>> # works reliably even if we forward from TCP to UDP
>>>>> #commented 11/02/05#######################
>>>>> if (!t_relay()) {
>>>>> sl_reply_error();
>>>>> };
>>>>>
>>>>> }
>>>>>
>>>>> ######################################entered
>>>>>
>>>>
>> 11/02/05############################################################
>>>>> route[1]
>>>>> {
>>>>> #!!Nathelper
>>>>> if(uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
>>>>> !search("^Route:")){
>>>>> sl_send_reply("479", "We don't forward to private IP addresses");
>>>>> break;
>>>>> };
>>>>>
>>>>> t_on_reply("1");
>>>>>
>>>>> if(!t_relay()){
>>>>> sl_reply_error();
>>>>> };
>>>>> }
>>>>> ######################################entered
>>>>>
>>>>
>> 11/02/05############################################################
>>>>> #!! Nathelper
>>>>> onreply_route[1]{
>>>>> 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();
>>>>> };
>>>>> }
>>>>>
>>>>
>> #####################################################################
>>>> #
>>>>> ###########################################
>>>>>
>>>>> # ------------- handling of unavailable user ------------------
>>>>> route[2] {
>>>>>
>>>>> # non-Voip -- just send "off-line"
>>>>> if (!(method == "INVITE" || method == "ACK" || method ==
>>>>> "CANCEL")) {
>>>>> sl_send_reply("404", "Not Found");
>>>>> break;
>>>>> };
>>>>>
>>>>> # forward to voicemail now
>>>>> rewritehostport("157.190.183.70:5062");
>>>>> t_relay_to_udp("157.190.183.70", "5062");
>>>>> }
>>>>>
>>>>> # if forwarding downstream did not succeed, try voicemail running
>>>>> # at 157.190.183.70:5062
>>>>>
>>>>> failure_route[1] {
>>>>> revert_uri();
>>>>> rewritehostport("157.190.183.70:5062");
>>>>> append_branch();
>>>>> t_relay_to_udp("157.190.183.70", "5062");
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> -------------------Legal
>>>>> Disclaimer---------------------------------------
>>>>>
>>>>> The above electronic mail transmission is confidential and
>> intended
>>>>> only for the person to whom it is addressed. Its contents may be
>>>>> protected by legal and/or professional privilege. Should it be
>>>>> received by you in error please contact the sender at the above
>>>>> quoted email address. Any unauthorised form of reproduction of
>> this
>>>>> message is strictly prohibited. The Institute does not guarantee
>>>> the
>>>>> security of any information electronically transmitted and is not
>>>>> liable if the information contained in this communication is not
>> a
>>>>> proper and complete record of the message as transmitted by the
>>>>> sender nor for any delay in its receipt.
>>>>>
>>>>> _______________________________________________
>>>>> Serusers mailing list
>>>>> serusers(a)lists.iptel.org
>>>>> http://lists.iptel.org/mailman/listinfo/serusers
>>>>
>>>>
>>>> -------------------Legal
>>>> Disclaimer---------------------------------------
>>>>
>>>> The above electronic mail transmission is confidential and
>> intended
>>>> only for the person to whom it is addressed. Its contents may be
>>>> protected by legal and/or professional privilege. Should it be
>>>> received by you in error please contact the sender at the above
>>>> quoted email address. Any unauthorised form of reproduction of
>> this
>>>> message is strictly prohibited. The Institute does not guarantee
>> the
>>>> security of any information electronically transmitted and is not
>>>> liable if the information contained in this communication is not a
>>>> proper and complete record of the message as transmitted by the
>>>> sender nor for any delay in its receipt.
>>>>
>>>
>>>
>>>
>>> -------------------Legal
>>> Disclaimer---------------------------------------
>>>
>>> The above electronic mail transmission is confidential and intended
>>> only for the person to whom it is addressed. Its contents may be
>>> protected by legal and/or professional privilege. Should it be
>>> received by you in error please contact the sender at the above
>>> quoted email address. Any unauthorised form of reproduction of this
>>> message is strictly prohibited. The Institute does not guarantee
>> the
>>> security of any information electronically transmitted and is not
>>> liable if the information contained in this communication is not a
>>> proper and complete record of the message as transmitted by the
>>> sender nor for any delay in its receipt.
>>
>>
>> -------------------Legal
>> Disclaimer---------------------------------------
>>
>> The above electronic mail transmission is confidential and intended
>> only for the person to whom it is addressed. Its contents may be
>> protected by legal and/or professional privilege. Should it be
>> received by you in error please contact the sender at the above
>> quoted email address. Any unauthorised form of reproduction of this
>> message is strictly prohibited. The Institute does not guarantee the
>> security of any information electronically transmitted and is not
>> liable if the information contained in this communication is not a
>> proper and complete record of the message as transmitted by the
>> sender nor for any delay in its receipt.
>>
>
>
>
> -------------------Legal
> Disclaimer---------------------------------------
>
> The above electronic mail transmission is confidential and intended
> only for the person to whom it is addressed. Its contents may be
> protected by legal and/or professional privilege. Should it be
> received by you in error please contact the sender at the above
> quoted email address. Any unauthorised form of reproduction of this
> message is strictly prohibited. The Institute does not guarantee the
> security of any information electronically transmitted and is not
> liable if the information contained in this communication is not a
> proper and complete record of the message as transmitted by the
> sender nor for any delay in its receipt.
----- Original Message -----
From: support
To: Jefrey ; serusers(a)lists.iptel.org
Sent: Friday, February 25, 2005 3:46 PM
Subject: Re: [Serusers] ser-0.8.14 / ser-0.9 + rtpproxy + PSTN
Hi,
Yes, this configuration allow SIP clients to call each other.
This is the updated config.
Thomas
#
# $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)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
listen=""
port=5060
children=4
fifo_mode=0666
fifo="/tmp/ser_fifo"
# ------------------ module loading ----------------------------------
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/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/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
# 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)
# -- Nathelper params --
modparam("registrar", "nat_flag", 6)
modparam("nathelper", "natping_interval", 30) # Ping interval
modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT
# ------------------------- request routing logic -------------------
# main routing logic
route{
# -----------------------------------------------
# Sanity Check Section
# -----------------------------------------------
# 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;
};
# -----------------------------------------------
# NOTIFY Keep-Alive Section
# -----------------------------------------------
if ((method=="NOTIFY") && search("^Event: keep-alive")) {
sl_send_reply("200","OK");
break;
};
# Nathelper
if (nat_uac_test("3")) {
# Allow RR-ed requests, as these may indicate that
# a NAT-enabled proxy takes care of it; unless it is
# a REGISTER
if (method == "REGISTER" || ! search("^Record-Route:")) {
fix_nated_contact(); # Rewrite contact with source IP of signalling
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
};
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
break;
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
break;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication
if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
break;
};
save("location");
break;
};
# if the dialed number lies in the range 35891500-35891799, don't forward it to T1 Trunk GW
if ((uri=~"^sip:(852|)358915[0-9][0-9]@") || (uri=~"^sip:(852|)358916[0-9][0-9]@") || (uri=~"^sip:(852|)358917[0-9][0-9]@")) {
if (uri=~"^sip:852*") {
strip(3);
};
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
break;
};
# native SIP destinations are handled using our USRLOC DB
# Call Routing Section
if (!lookup("location")) {
if (uri=~"^sip:(852|)[0-9]{8}@") {
# Send to PSTN Gateway
route(2);
break;
};
sl_send_reply("404", "User Not Found");
break;
};
};
append_hf("P-hint: usrloc applied\r\n");
route(1);
}
route[1]
{
# Nathelper
if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" && !search("^Route:")){
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();
break;
};
}
# PSTN Call to T1 Trunk GW
route[2] {
rewritehostport("");
if (isflagset(6)) {
force_rtp_proxy();
};
t_on_reply("1");
if (!t_relay()) {
sl_reply_error();
break;
};
}
# !! Nathelper
onreply_route[1] {
# NATed transaction ?
if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
fix_nated_contact();
# Not all 2xx messages have a content body so here we make sure
# out Content-Length > 0 to avoid a parse error
if (!search("^Content-Length:\0")) {
force_rtp_proxy();
};
# otherwise, is it a transaction behind a NAT and we did not
# know at time of request processing ? (RFC1918 contacts)
} else if (nat_uac_test("1")) {
fix_nated_contact();
};
}
---------end of config -----------
Hi,
Yes, this configuration allow SIP clients to call each other.
This is the updated config.
Thomas
#
# $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)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
listen=""
port=5060
children=4
fifo_mode=0666
fifo="/tmp/ser_fifo"
# ------------------ module loading ----------------------------------
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/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/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
# 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)
# -- Nathelper params --
modparam("registrar", "nat_flag", 6)
modparam("nathelper", "natping_interval", 30) # Ping interval
modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT
# ------------------------- request routing logic -------------------
# main routing logic
route{
# -----------------------------------------------
# Sanity Check Section
# -----------------------------------------------
# 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;
};
# -----------------------------------------------
# NOTIFY Keep-Alive Section
# -----------------------------------------------
if ((method=="NOTIFY") && search("^Event: keep-alive")) {
sl_send_reply("200","OK");
break;
};
# Nathelper
if (nat_uac_test("3")) {
# Allow RR-ed requests, as these may indicate that
# a NAT-enabled proxy takes care of it; unless it is
# a REGISTER
if (method == "REGISTER" || ! search("^Record-Route:")) {
fix_nated_contact(); # Rewrite contact with source IP of signalling
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
};
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
break;
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
break;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication
if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
break;
};
save("location");
break;
};
# if the dialed number lies in the range 35891500-35891799, don't forward it to T1 Trunk GW
if ((uri=~"^sip:(852|)358915[0-9][0-9]@") || (uri=~"^sip:(852|)358916[0-9][0-9]@") || (uri=~"^sip:(852|)358917[0-9][0-9]@")) {
if (uri=~"^sip:852*") {
strip(3);
};
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
break;
};
# native SIP destinations are handled using our USRLOC DB
# Call Routing Section
if (!lookup("location")) {
if (uri=~"^sip:(852|)[0-9]{8}@") {
# Send to PSTN Gateway
route(2);
break;
};
sl_send_reply("404", "User Not Found");
break;
};
};
append_hf("P-hint: usrloc applied\r\n");
route(1);
}
route[1]
{
# Nathelper
if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" && !search("^Route:")){
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();
break;
};
}
# PSTN Call to T1 Trunk GW
route[2] {
rewritehostport("");
if (isflagset(6)) {
force_rtp_proxy();
};
t_on_reply("1");
if (!t_relay()) {
sl_reply_error();
break;
};
}
# !! Nathelper
onreply_route[1] {
# NATed transaction ?
if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
fix_nated_contact();
# Not all 2xx messages have a content body so here we make sure
# out Content-Length > 0 to avoid a parse error
if (!search("^Content-Length:\0")) {
force_rtp_proxy();
};
# otherwise, is it a transaction behind a NAT and we did not
# know at time of request processing ? (RFC1918 contacts)
} else if (nat_uac_test("1")) {
fix_nated_contact();
};
}
---------end of config -----------
----- Original Message -----
From: Jefrey
To: 'support'
Sent: Wednesday, February 23, 2005 10:44 PM
Subject: RE: [Serusers] ser-0.8.14 / ser-0.9 + rtpproxy + PSTN
Hi
Just needing some of your expertise, does this configuration allow your SIP clients to call each other?
Regards,
Jef.
------------------------------------------------------------------------------
From: serusers-bounces(a)iptel.org [mailto:serusers-bounces@lists.iptel.org] On Behalf Of support
Sent: Monday, February 14, 2005 5:42 PM
To: serusers(a)lists.iptel.org
Subject: [Serusers] ser-0.8.14 / ser-0.9 + rtpproxy + PSTN
Hi,
After studying some ser.cfg files, I could route a SIP call to PSTN gateway successfully.
If ser receives "866+any PSTN num", ser will forward to T1 trunk gateway. T1 trunkgateway will drop the prefix 866 and route the call out to PSTN line.
i.e. SIP client (866+PSTN num) ---> T1 Trunk Gateway (drop prefix 866) ---> PSTN call (PSTN num)
SER version: ser-0.8.14 or ser-0.9.
rtpproxy version: latest cvs version from berlios
I have posted a ser.cfg in this email.
Best Regards,
Thomas
#
# $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)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
listen=""
port=5060
#children=4
fifo_mode=0666
fifo="/tmp/ser_fifo"
# ------------------ 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/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"
# 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"
# Nathelper
loadmodule "/usr/local/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)
# -- Nathelper params --
modparam("registrar", "nat_flag", 6)
modparam("nathelper", "natping_interval", 30) # Ping interval
modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT
# ------------------------- 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;
};
# Nathelper
if (nat_uac_test("3")) {
# Allow RR-ed requests, as these may indicate that
# a NAT-enabled proxy takes care of it; unless it is
# a REGISTER
if (method == "REGISTER" || ! search("^Record-Route:")) {
log("LOG: Someone trying to register from private IP, rewriting\n");
# This will work only for user agents that support symmetric
# communication. We tested quite many of them and majority is
# smart enough to be symmetric. In some phones it takes a configuration
# option. With Cisco 7960, it is called NAT_Enable=Yes, with kphone it is
# called "symmetric media" and "symmetric signalling".
fix_nated_contact(); # Rewrite contact with source IP of signalling
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
};
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
break;
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
break;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication
if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
break;
};
save("location");
break;
};
if (uri=~"^sip:866*") {
log(1, "going to PSTN route\n");
route(2);
break;
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
break;
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};
};
append_hf("P-hint: usrloc applied\r\n");
route(1);
}
route[1]
{
# !! Nathelper
if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" && !search("^Route:")){
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();
break;
};
}
route[2] {
force_rtp_proxy();
record_route();
t_on_reply("1");
t_relay_to_udp("T1 gateway IP","T1 Gateway UDP port");
}
# !! Nathelper
onreply_route[1] {
# NATed transaction ?
if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {
fix_nated_contact();
# Not all 2xx messages have a content body so here we make sure
# out Content-Length > 0 to avoid a parse error
if (!search("^Content-Length:\0")) {
force_rtp_proxy();
};
# otherwise, is it a transaction behind a NAT and we did not
# know at time of request processing ? (RFC1918 contacts)
} else if (nat_uac_test("1")) {
fix_nated_contact();
};
}
Hi All,
I am facing problem to get SER to do a SRV lookup. I have the following
scenario...
Step 1:
SIP UA1 registers with SER (testdomain.com) with contact address
user(a)testdomain.com
SIP UA2 registers with SER (testdomain.com) with contact address
user(a)testdomain.com
Step 2:
SIP UA3 calls user(a)testdomain.com
Problem
I would expect SER to do a DNS SRV lookup on testdomain.com and get
sip1.testdomain.com and sip2.testdomain.com. Unfortunately, SER only
does A and AAAA query. (verified via ethereal) and does not do SRV
lookup. How can I make it do SRV lookup ? I am using the default ser.cfg
file.
DNS entries
_sip._udp.testdomain.com. 3600 IN SRV
0 1 5060 sip1.testdomain.com.
_sip._udp.testdomain.com. 3600 IN SRV
0 1 5060 sip2.testdomain.com.
I am trying to do load balancing but the SRV lookup failure has got me
stuck. Any pointers would be really appreciated.
Thanks,
Chetan
I have had SER working fine for over a month now, but after a reboot
yesterday, it exhibited a bizarre behavior as follows:
t_relay_to_tcp sends INVITE from the wrong IP address. I have a dell
server with 2 network cards each with its own IP address. SER is
listening on one of them (listen=<IP> in ser.cfg) and there is no
problem with incoming requests. However, SER sends outgoing INVITEs with
the wrong IP address. This was not the case before and I have had it
working across several reboots. If I replace t_relay_to_tcp() with just
t_relay(), it works fine but I need SIP over TCP and hence need to use
t_relay_to_tcp()
How do I get t_relay_to_tcp() to use the proper IP address for sending
SIP messages? I tried rebooting couple times, just to ensure that this
was not some transient problem, but it id not change the behavior.
Hello list:
my ser and rtpproxy is behind firewall and NAT
my client (Kphone) is also behind firewall and NAT but in different network
my address is : beeplove(a)projuktee.com
Would anybody mind to give me a buzz.
Thanks
Mohammad
Hi.
Problem:
SER doesn't talk to rtpproxy or mediaproxy. Nothing even in the syslog
file.
I'm running SER 0.8.14 on debian 2.4.27-1-686 machine. For whatever NAT
support I choose, it seems that I can't get right. I have followed
Paul's post and the default config file without success.
My NAT is a Linux box.
Scernario I: rtpproxy
**ser.cfg snippet - (debug=9)***
if (nat_uac_test("3")) {
log(1, "src address different than via header->NAT detected\n");
log(1, "force_rport and fix_nated_contact and setflag(6)\n");
if (method=="REGISTER" || ! search("^Record-Route:")) {
log(1, " ....it is Register....\n");
fix_nated_contact();# Rewrite contact with source IP of signalling
log(1, ".....fix_nated_contact....\n");
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
};
append_hf("P-hint: fixed NAT contact for request\r\n");
};
****Starting rtpproxy****
# ./rtpproxy -f
rtpproxy: rtpproxy started, pid 30483)
****Starting SER****snippet***
1(31771) DEBUG: init_mod_child (-1): nathelper
1(31771) rtpp_test: RTP proxy found, support for it enabled
1(31771) DEBUG: init_mod_child (-1): auth_db
2(31772) DEBUG: init_mod_child (-2): group
2(31772) DEBUG: init_mod_child (-2): uri
2(31772) DEBUG: init_mod_child (-2): acc
2(31772) DEBUG: init_mod_child (-2): nathelper
2(31772) rtpp_test: RTP proxy found, support for it enabled
*****Registering client behind NAT*****snippet**
..............
0(31769) entering main loop
0(31769) DEBUG : is_maxfwd_present: max_forward header already found!
0(31769) DEBUG: is_maxfwd_present: value = 70
0(31769) check_via_address(130.2xx.2xx.xx, 10.0.0.17, 0)
0(31769) src address different than via header->NAT detected
0(31769) force_rport and fix_nated_contact and setflag(6)
0(31769) ....it is Register....
0(31769) parse_headers: flags=64
0(31769) .....fix_nated_contact....
0(31769) parse_headers: flags=-1
0(31769) DEBUG: get_hdr_body : content_length=0
0(31769) found end of header
0(31769) end of header reached, state=9
0(31769) parse_headers: flags=256
0(31769) find_first_route(): No Route headers found
0(31769) loose_route(): There is no Route HF
0(31769) check_self - checking if host==us: 16==14 && [mm.mml.mm.se]
== [192.16.xxx.xx]
0(31769) check_self - checking if port 5060 matches port 5060
0(31769) parse_headers: flags=4096
--------------------------------------------------------------------------
Scernario II: mediaproxy
**ser.cfg snippet - (debug=9)***
# Mark as NAT'ed
if (client_nat_test("3")) {
log(1, "Is NAted\n");
setflag(2);
log(1, "----NAted flag set----\n");
force_rport();
log(1, "...rport forced....\n");
fix_contact();
log(1, "...contact fixed...\n");
#break;
};
****Starting mediaproxy****
Feb 24 16:45:17 voip mediaproxy[29715]: mediaproxy started.
Feb 24 16:45:17 voip mediaproxy[29715]: Listening for commands on local
socket `/var/run/mediaproxy.sock'
Feb 24 16:45:17 voip mediaproxy[29715]: Listening for remote commands is
disabled
Feb 24 16:45:17 voip mediaproxy[29715]: Using IP address `192.16.xxx.xx'
for the RTP/RTCP proxy
Feb 24 16:45:18 voip proxydispatcher[29718]: proxydispatcher started.
Feb 24 16:45:18 voip proxydispatcher[29718]: Listening for commands on
local socket `/var/run/proxydispatcher.sock'
Feb 24 16:45:18 voip proxydispatcher[29718]: Default mediaproxy server
is on `/var/run/mediaproxy.sock'
****Starting SER****snippet***
0(0) fixing /usr/local/lib/ser/modules/maxfwd.so
mf_process_maxfwd_header
0(0) fixing /usr/local/lib/ser/modules/sl.so sl_send_reply
0(0) fixing /usr/local/lib/ser/modules/sl.so sl_send_reply
0(0) fixing /usr/local/lib/ser/modules/mediaproxy.so client_nat_test
0(0) fixing /usr/local/lib/ser/modules/mediaproxy.so fix_contact
0(0) fixing /usr/local/lib/ser/modules/registrar.so save
*****Registering client behind NAT*****snippet**
1(32184) ..............
1(32184) entering main loop
1(32184) DEBUG : is_maxfwd_present: max_forward header already found!
1(32184) DEBUG: is_maxfwd_present: value = 70
1(32184) parse_headers: flags=64
1(32184) Is NAted
1(32184) ----NAted flag set----
1(32184) ...rport forced....
1(32184) parse_headers: flags=64
1(32184) parse_headers: flags=33554432
1(32184) ...contact fixed...
1(32184) check_self - checking if host==us: 16==14 &&
[voip.ssvl.kth.se] == [192.16.xxx.xx]
1(32184) check_self - checking if port 5060 matches port 5060
1(32184) URI myself
1(32184) Method Register
1(32184) parse_headers: flags=-1
1(32184) DEBUG: get_hdr_body : content_length=0
1(32184) found end of header
1(32184) parse_headers: flags=33554432
1(32184) parse_headers: flags=-1
1(32184) check_via_address(130.2xx.2xx.xx, 10.0.0.17, 0)
1(32184) Success - Registration...
***END****
In both cases, tested separately:-
->UA get registered with the local IP,
->Check points set indicate "fix_nated_contact()" passed
Where is the problem!!??