You have several choices (like always on Unix):
1. Do like this:
if (method=="INVITE") {
# save messages in mysql for CDRTool
exec_msg("/etc/ser/sertrace.py; exit 1");
};
Make your own script to replace /etc/ser/sertrace.py
You can log the whole SIP packet from STDIN to mysql and index it by
environment variable set by SER (SIP_HF_CALLID).
To scale it up a bit you demonize the logger to reuse only one mysql
connection.
2. Log all SIP packets to a log file with a script like this one:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<
#!/bin/sh
#
# chkconfig: 2345 20 80
# description: controls execution of SIP sniffer
# processname: ng
NAME=ngrep
OPTIONS="-L -d bond0 -t port 5060"
BIN=/usr/bin/ngrep
ROTATE=/usr/sbin/rotatelogs
RETVAL=0
# See how we were called.
case "$1" in
start)
killall $NAME
echo -n "Starting SIP sniffer: "
$BIN $OPTIONS 2>&1 | $ROTATE /var/log/ser/trace/sip 86400 &
RETVAL=$?
echo "ngrep."
;;
stop)
echo -n "Stopping SIP ngrep: "
killall $NAME
RETVAL=$?
echo "done."
;;
restart)
#$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL
<<<<<<<<<<<<<<<<<<<<<<<<
--
Adrian
How to get the call log and registration request in a
different file other that /var/log/messages.
Also, can i get some more details on autherisation and
accountingpackets. Rt now, iam getting only details
given below.
ACC: transaction answered: method=BY
E, i-uri=sip:12334 at 10.10.0.1,
o-uri=sip:12334 at 10.10.0.1, call_id
=4F6F069B-4BF4-4CC7-B99C-4E24F0E2C667 at 192.168.10.154,
from=Manu Sip <sip:manu at s
ip.test.net>;tag=2654486816, code=200
thank you.
MANU.
I have also had problems with getting the ACK back.
I don't completely understand your configuration, you
must allow for packets going both directions, right?
Here is my config :
route
{
# check to see if the message has been around too long
# probably means that it is looping
#
if (!mf_process_maxfwd_header("10"))
{
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
break;
};
#
# make sure the length of the message isn't too long!
#
if (len_gt( max_len ))
{
sl_send_reply("513", "Wow -- Message too large");
break;
};
#
# do the loose-routing thing, this is important!
#
if(loose_route())
{
log(1,"doing top loose route");
t_relay();
break;
};
# this is where I was dropping the ACKS.
# I was simply dropping these, but they must be relayed
# because they can be ACKs
if(!(uri==myself))
{
if(!t_relay())
{
sl_reply_error();
break;
};
break;
};
This gets the ACKs through for me.
By the way, I have this configured with Cisco ATAs, version 2.16.
---greg
>
>I have the same problem and posed it to the group yesterday ([Serusers]
>Ignored 200 OK message.) So far the only workaround that I have found is to
>use the rules in my gateway to rewrite the dialed digits before sending them
>to the PSTN PRI, thus leaving the origianl URI intact for SIP
>communications.
>
>One person told me that this is a bug in the Cisco ATA, but it happens on my
>IPDialog phones also. It seems to me that the INVITE is being processed by
>the SER dial rules and is rewritten, but the ACK is not.
>
>Sean
>_______________________________________________
>
>Sean Robertson
>
>NETXUSA
>p. 800-289-6389
>f. 864-233-4344 "Ask me about Voice over IP."
>http://www.netxusa.com/
>
>----- Original Message -----
>From: "Alexander Mayrhofer" <axelm(a)nic.at>
>To: <serusers(a)lists.iptel.org>
>Sent: Friday, June 27, 2003 12:15 PM
>Subject: [Serusers] rewrite & ACK forwarding problem
>
>
>>
>> Hi,
>>
>> we're running SER together with a PSTN Gateway. Before a call get's
>> forwarded to the gateway, we are rewriting the request URI to make
>> rewriting on the GW as simple as possible:
>>
>> route {
>> ...
>> strip(3); # +43xxx -> xxx
>> prefix("0"); # xxx -> 0xxx
>> rewritehostport(xxx.xxx.xxx.xxx, 5060); # request to gateway
>> route(1);
>> break;
>> ...
>>
>> SIP call flow looks like (record route enabled):
>>
>> (1) phone -> SER
>> INVITE sip:*43699xxxxxxxx@nic.at43.at SIP/2.0
>>
>> (2) SER -> phone
>> SIP/2.0 100 trying -- your call is important to us
>>
>> (3) SER -> GW
>> INVITE sip:0699xxxxxxxx@xx.xx.xx.xx:5060 SIP/2.0
>>
>> (4) GW -> SER
>> SIP/2.0 100 Trying
>>
>> (5) GW -> SER
>> SIP/2.0 183 Session Progress
>>
>> (6) SER -> phone
>> SIP/2.0 183 Session Progress
>>
>> (7) GW -> SER
>> SIP/2.0 180 Ringing
>>
>> (8) SER -> phone
>> SIP/2.0 180 Ringing
>>
>> (9) GW -> SER
>> SIP/2.0 200 OK
>> Contact: <sip:0699xxxxxxxx@xx.xx.xx.xx:5060>
>>
>> (10) SER -> phone
>> SIP/2.0 200 OK
>> Contact: <sip:0699xxxxxxx@xx.xx.xx.xx:5060>
>>
>> [ call established, we can talk, but ... ]
>>
>> (11) phone -> SER
>> ACK sip:0699xxxxxxxx@xx.xx.xx.xx:5060 SIP/2.0
>>
>> --> Here starts the problem. That ACK (11) never gets forwarded to the
>> Gateway, so after a few seconds, the GW starts over at (9). Those three
>> packets (9-11) repeat a few times until GW runs into a timeout and drops
>> the call.
>>
>> I have the impression that SER can't match the packet to the previous
>> requests because of the rewritten URI. Is that correct?
>>
>> The only output at debug level 3 is:
>>
>> Warning: sl_send_reply: I won't send a reply for ACK!!
>>
>> Is that a routing goof somewhere in our scripts or is that a more
>> generic problem? Is the problem that the warning indicates somehow
>> related to the fact that the ACK is not being forwarded?
>>
>> Help appreciated.
>>
>> cheers
>>
>> axelm
>>
>> _______________________________________________
>> Serusers mailing list
>> serusers(a)lists.iptel.org
>> http://lists.iptel.org/mailman/listinfo/serusers
>>
>
>
>_______________________________________________
>Serusers mailing list
>serusers(a)lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers
>
Maxim,
Managed DNS platform (based in Amsterdam) provides all required
functions to managed User or Infrastructure ENUM in a controlled
environment.
The system went through an 8 months trial period and the results will
be presented on the 24-th of February at ETSI
http://www.etsi.org/plugtests/02UpcomingEvents/ENUMWORKSHOP.htm
The system entered in production phase just last week.
See www.ag-projects.com for more information.
---
Adrian Georgescu
ag-projects.com
>>>>>>>
Folks,
One of our clients asks us if we can set up ENUM
client for him, so that his customers are able to
call users in big free and commercial VoIP SIP
networks.
He claims that at least some of them already have
ENUM zones delegated to them and operating.
Can somebody shed some light on current state
of ENUM and whether or not it is feasible to use
it now.
Thanks!
-Maxim
i've been getting my sea legs with SER and am having trouble getting
rtpproxy to nathelper to work correctly with my setup. since everything
works fine if i test the scenario with a freeworld dialup account, i'm
assuming that my problems are solely due to the vastness of my ignorance
on how to configure SER correctly.
i have three x-lite clients [ one is running on windows 2000 not sure of
the build number, but it's the latest download from the website; the
other two clients are both build 1101 on mac 10.2.3. SER running on a
rh9 box on a public IP with rtpproxy. i installed ser-0.8.12-0.i386.rpm
which i downloaded from the ftp server. the x-lite clients are sitting
behind a linksys befw11s4 nat router.
i can run SER without nathelper/rtpproxy and make and receive calls to
clients outside the my network. however, things fall apart quickly when
i try to run more than one client behind the nat [ lost audio, timeouts
etc] which i presume is what nathelper is supposed to deal with. if try
to run to use nathelper, i can't make a call from a one client to
another client behind the lan. the calls won't go through - they simply
timeout.
i downloaded and compiled rtpproxy which i obtained from the portaone
website and simply started it from the command line. i can't figure out
how to get any debugging messages from rtpproxy, but i can see that the
process exists and /var/run/rtpproxy.sock is created.
i altered ser.cfg using the template i found in the ser-0.8.12_src
tarball [ /modules/nathelper/nathelper.cfg ]. see my config below [1].
i understand that things have changed quite a bit in the CVS head, but
i tried to compile and install the latest CVS version, but i ran into a
host of config errors using the nathelper.cfg supplied, so i decided to
backtrack, gather my wits, and stick with the released version.
the x-lite clients appear to register appropriately with the server [2 -
public ip addresses have been changed to protect the innocent]. to my
untrained eye, these messages look the same as what i see when i test
things using freeworld dialup accounts and i can make a call to another
client on the same lan segment - i.e. the internal IP addresses are
being sent. the location database also shows that the internal IP
addresses are being used [3], but i don't know if this is what i want or
not. oh. i'm also using my.public.box - a FQDN - as in the x-lite
fields where it asks for "Domain/Realm", "SIP Proxy" and "Out Bound Proxy".
so anyone care to grab me by the lapels and point out what i'm obviously
doing wrong :-)
[1]
#
# $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"
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
#loadmodule "/usr/lib/ser/modules/mysql.so"
loadmodule "/usr/lib/ser/modules/nathelper.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"
# ----------------- 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)
alias="my.public.box"
# ------------------------- 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;
};
# compulsory processing of Route header fields and adding RR
loose_route();
/* registration (uses rewritten contacts) */
if (method=="REGISTER") {
save("location");
break;
};
if (method=="INVITE") {
record_route();
if (isflagset(1)) { # ATA ?
fix_nated_sdp("3");
};
/* set up reply processing */
t_on_reply("1");
};
if (method == "INVITE" || method == "CANCEL") {
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};
};
/* set up reply processing and forward statefuly */
t_relay();
}
# all incoming replies for t_onrepli-ed transactions enter here
onreply_route[1] {
if (status=~"2[0-9][0-9]")
fix_nated_contact();
fix_nated_sdp("3");
}
[2]
Established SIP protocol listen on: 192.168.1.100:5060
Discovered Restricted Cone NAT Firewall
SIP: 192.168.1.100:5060
RTP: 192.168.1.100:8000
NAT: my.router.public.ip
PROXY#0: ser.public.ip:5060
OUTBOUND-PROXY#0: ser.public.ip:5060
SEND >> ser.public.ip:5060
REGISTER sip:my.public.box SIP/2.0
Via: SIP/2.0/UDP
192.168.1.100:5060;rport;branch=z9hG4bK9DF27D98551C11D882E3000393B930BA
From: snowdeal <sip:123@my.public.box>
To: snowdeal <sip:123@my.public.box>
Contact: "snowdeal" <sip:123@192.168.1.100:5060>
Call-ID: 9DA51D06551C11D882E3000393B930BA(a)my.public.box
CSeq: 56648 REGISTER
Expires: 1800
Max-Forwards: 70
User-Agent: X-Lite build 1101
Content-Length: 0
RECEIVE << ser.public.ip:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.1.100:5060;rport=5060;branch=z9hG4bK9DF27D98551C11D882E3000393B930BA;received=my.router.public.ip
From: snowdeal <sip:123@my.public.box>
To: snowdeal
<sip:123@my.public.box>;tag=b27e1a1d33761e85846fc98f5f3a7e58.3894
Call-ID: 9DA51D06551C11D882E3000393B930BA(a)my.public.box
CSeq: 56648 REGISTER
Contact: <sip:123@192.168.1.100:5060>;q=0.00;expires=1800
Server: Sip EXpress router (0.8.12 (i386/linux))
Content-Length: 0
Warning: 392 ser.public.ip:5060 "Noisy feedback tells: pid=21653
req_src_ip=my.router.public.ip req_src_port=5060
in_uri=sip:my.public.box out_uri=sip:my.public.box via_cnt==1"
----------
Established SIP protocol listen on: 192.168.1.101:5060
Discovered Restricted Cone NAT Firewall
SIP: 192.168.1.101:5060
RTP: 192.168.1.101:8000
NAT: my.router.public.ip
PROXY#0: 69.55.224.151:5060
OUTBOUND-PROXY#0: 69.55.224.151:5060
SEND >> ser.public.ip:5060
REGISTER sip:my.public.box SIP/2.0
Via: SIP/2.0/UDP
192.168.1.101:5060;rport;branch=z9hG4bKAC7BFFFD551C11D8B317000A957BC13A
From: kristine <sip:456@my.public.box>
To: kristine <sip:456@my.public.box>
Contact: "kristine" <sip:456@192.168.1.101:5060>
Call-ID: AC7B8E18551C11D8B317000A957BC13A(a)my.public.box
CSeq: 55034 REGISTER
Expires: 1800
Max-Forwards: 70
User-Agent: X-Lite build 1101
Content-Length: 0
RECEIVE << ser.public.ip:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.1.101:5060;rport=15060;branch=z9hG4bKAC7BFFFD551C11D8B317000A957BC13A;received=my.router.public.ip
From: kristine <sip:456@my.public.box>
To: kristine
<sip:456@my.public.box>;tag=b27e1a1d33761e85846fc98f5f3a7e58.b0ef
Call-ID: AC7B8E18551C11D8B317000A957BC13A(a)my.public.box
CSeq: 55034 REGISTER
Contact: <sip:456@192.168.1.101:5060>;q=0.00;expires=1800
Server: Sip EXpress router (0.8.12 (i386/linux))
Content-Length: 0
Warning: 392 ser.public.ip:5060 "Noisy feedback tells: pid=21658
req_src_ip=my.router.public.ip req_src_port=15060
in_uri=sip:my.public.box out_uri=sip:my.public.box via_cnt==1
[3]
===Domain list===
---Domain---
name : 'location'
size : 512
table: 0x402d60d8
d_ll {
n : 2
first: 0x402d80e0
last : 0x402d81c8
}
...Record(0x402d80e0)...
domain: 'location'
aor : '123'
~~~Contact(0x402d8120)~~~
domain : 'location'
aor : '123'
Contact: 'sip:123@192.168.1.100:5060'
Expires: 583
q : 0.00
Call-ID: '9DA51D06551C11D882E3000393B930BA(a)my.public.box'
CSeq : 56648
replic : 0
State : CS_NEW
Flags : 0
next : (nil)
prev : (nil)
~~~/Contact~~~~
.../Record...
...Record(0x402d81c8)...
domain: 'location'
aor : '456'
~~~Contact(0x402d8208)~~~
domain : 'location'
aor : '456'
Contact: 'sip:456@192.168.1.101:5060'
Expires: 614
q : 0.00
Call-ID: 'AC7B8E18551C11D8B317000A957BC13A(a)my.public.box'
CSeq : 55034
replic : 0
State : CS_NEW
Flags : 0
next : (nil)
prev : (nil)
~~~/Contact~~~~
.../Record...
---/Domain---
===/Domain list===
Hey...
When you call a cisco 7960 f.eks. you see a text string with the name
of a user. .. Is it possible "hook" ser upto a database, witch contains
the whole phonecatalog. then make ser lookup a number, then put it into
the realname feeld ?
- Atle
Hi!
After a long search on maillinst, I'm trying to run SER with rtpproxy, for
resolve problems with SIP UA (ata186) behind a nat, but I'm still get in trouble.
I have setup ser.cfg to use rtpproxy, like this:
...
if (method=="INVITE") {
log(1,"INVITE\n");
fix_nated_sdp("1");
record_route();
force_rport();
setflag(1);
force_rtp_proxy();
t_on_reply("1");
}
...
onreply_route[1] {
log(1, ">=====> reply 1\n");
if ((status=~"[12][0-9][0-9]")) {
force_rtp_proxy();
}
}
...
But I get this error on syslog:
0(5463) ERROR: extract_mediaip: no `c=' in SDP
I'm running rtpproxy, on linux shell without any parameters.
Does anybody knows what this means that message, and how to solve, a ser.cfg for
rtpproxy, and others tips will be helpfull...
Regards.
--
|o
|o A prosperidade faz amigos. A adversidade testa-os. -- Pubililius
|o Syrus
|o
|o Fabio Silvestri
|o fabio(a)informatec.com.br
|o ICQ: 1667351
|o
--
|o
|o The number you have dialed is imaginary. Please divide by 0 and
|o try again.
|o
|o Fabio Silvestri
|o fabio(a)informatec.com.br
|o ICQ: 1667351
|o
Have pushed on not very far it seems with testing of SER using Windows
Messenger v5.0 (on windows 2000) as UA
have modded the default ser.cfg with an alias statement to reflect the
domain name of the sip clients.
this has allowed me to get through the process of getting to sip clients to
register with the sip proxy server
this is apparently confirmed by status codes of 200 reported in the SIP
register messages.
i fall at the next hurdle of using WM 5.0 to send an instant message (same
applies to file tranfer) to a contact
WM reports "The following message <message text> could not be delivered to
all recipients"
have captured the data from the client which i now summarise;
1. SIP message - INVITE (recipient of the message) to the sip proxy
the first response is a SIP status code 100 (which i assume to be some sort
of comfort signal)
followed by status code 200 - which i assume to be the success response
2. followed by a BYE message from the proxy server to the client and a
corresponding ACK from the client to the proxy server
3. SIP / SDP MESSAGE from the client to the proxy server
note - the decode of the SDP data section reports "Invalid Line" - followed
by text of the Instant message
don't know if this is limitation of the Ethereal decoding ??
this is somewhat surprisingly followed by a message with Status Code 200
from client to proxy
4. final death knell of the communication would seem to be a SIP message
from proxy to the client with a status code 481 - decoded as "call leg /
transaction does not exist"
What I am conscious of is that the source / target sip recipients
"user1(a)mydomain.com and user2(a)mydomain.com" have not been defined to the
SIP proxy
i have taken p28 of the SER admin guide to be good to its word that
"default configuration script allows users to register with each other" or
have i taken this a bit too literal and that some user setup needs to be
done
my initial thought was that the sip register to the proxy server would
create some sort of dynamic entry in what i think is termed as the user
contact table in SER.
don't know if i am experiencing vagaries of the Microsft messenger UA -
would be glad to know of any other "soft" SIP UA applications
apologies for the essay - hope the mailing list can be of help here .
GT
hi,
I have a user agent which can only register using numerical usernames
(i.e. something that looks like a phone number), but I want to handle
the request as if it was send with user's "normal" username (which is
alphanumerical). is this doable in ser? can make the REGISTER
processing look up this "alias" in a database table?
jakob
All:
Please bear with me... I'm having a hard time formulating this quesiton.
Basics:
ser-0.8.12 from src
rtpproxy = $Id: main.c,v 1.19.2.10 2003/10/18 20:14:22 sobomax Exp
RH 7.3 updated to: [root@sip2 rtpproxy]# uname -a
Linux sip2.claritycolorado.com 2.4.20-20.7 #1 Mon Aug 18 14:56:30 EDT
2003 i686
unknown
The problem seems to be that I cannot "always" forward calls to a given
destination if I have executed the force_rtp_proxy.
Typically I'm using a UA like a Cisco ATA, PureData, or softphone behind
a firewall. They in-turn register to SER/rtpproxy at a legal IP
address; most calls are then forwarded to a Vega gateway that resides on
the same network as SER/rtpproxy (in Denver). In this instance all is
well. However, when I try to alt route calls to an "off-network" source
(Cisco in LA and Sonus in Houston) I get two different and disturbing
results:
1. Cisco will not respond to SER: Cisco simply indicates in its own
logs that the INVITE is invalid and thus "trashed" the message
2. Sonus will respond with a "Bad Request"
Below are some snippets:
Prior to calling the route I have already I identified whether or not my
UA is behind a firewall and have fix_nated_contact(), force_rport(),
setflag(1)
SER/rtpproxy is running at 64.47.72.12
# Clarity Vega Evergreen CO -- this one works
route[1]
{
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;
};
record_route();
if (isflagset(1)) {
fix_nated_sdp("1");
force_rtp_proxy();
t_on_reply("2");
}
rewritehostport("64.47.72.10:5060");
t_relay();
}
# Clarity Cisco AS5300 LA -- this one does not
route[2]
{
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;
};
record_route();
if (isflagset(1)) {
fix_nated_sdp("1");
force_rtp_proxy();
t_on_reply("2");
}
rewritehostport("198.77.133.30:5060");
t_relay();
}
# Clarity Sonus Houston -- this one does not
route[3]
{
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;
};
record_route();
if (isflagset(1)) {
fix_nated_sdp("1");
force_rtp_proxy();
t_on_reply("2");
}
rewritehostport("64.47.6.6:5060");
t_relay();
}
/* inbound */
onreply_route[2] {
fix_nated_contact();
fix_nated_sdp("1");
force_rtp_proxy();
}
Please... If you have any ideas... I'm really stuck.
Jac Barben