Hello,
I've been working whit SER for a while, and I need to have some way of redirecting Invites dynamicly. The idea is similar to the definition of groups (local,ld,...), only I want to be able to define the redirection address without having to rewrite ser.cfg (and therefor reinitialize SER).
The part of defining these new groups and addresses was straightforward, after that I tried to build a module that would have a function to do the writing of the "To" URI. The only function I found to alter the destination URI was append_branch. The module compiles without error and SER works normally, except it does not do the redirections that I was hoping.
Are there any other ways of adding/rewriting something to the body of "To" in the SIP message? Or one can only do that in ser.cfg?
Thanks in advance,
José Nunes
sorry for again and again because my mail seems to be unreadable
Pls help me to config ser.cfg
Now my envirmonet is:
ser server: 172.16.255.1:5060 ( without DNS server )
SIP PSTN gateway: 172.16.255.1:6050
SIP UA: 172.16.2.xx
And all SIP UAs have a PSTN number like 6169xxxx
There are no DNS server in the system.(we don't apply for a domain name)
I want:
1 All users use digest authorization when SIP UA registing ------ finished
2 All calls from SIP UA need authorization (return 407 to Invite request)
3 All calls to PSTN transfer to the SIP PSTN gateway(number no like "6169xxxx") -------- almost finished
3 All calls from the SIP PSTN gateway do not need authorization(I think use a caller sip:gateway@172.16.255.1:6050 as caller when call from gateway,then all call from this user and this ip address needn't authorazation)
4 All calls need write CDR record to mysq datebase
The bigest problem is I don't know how to write conditonal sentence , like
if(uri!=~"xxxx")
or
if((uri=="xxxx") | (uri=="yyyy"))
There are no document talking about the syntax.
Please help me. Any help is appreciate.
Now my ser.cfg is:
#
# $Id: ser.cfg,v 1.21.2.1 2003/07/30 16:46:18 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
*/
debug=7
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/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)
# ------------------------- 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 (len_gt( max_len )) {
sl_send_reply("513", "Message too big");
break;
};
# 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
record_route();
# loose-route processing
if (loose_route()) {
t_relay();
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("novsky.com", "subscriber")) {
www_challenge("novsky.com", "0");
break;
};
save("location");
break;
};
# native SIP destinations are handled using our USRLOC DB
# if (!lookup("location")) {
# if(uri=~"^sip:6169*@") {
# forward(172.16.255.1,6050);
# break;
# };
# else {
# sl_send_reply("404", "Not Found");
# break;
# };
# };
if(uri=~"^sip:6169[0-9]*@[0-9|\.]*") {
if(!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};
};
forward(172.16.255.1,6050);
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();
};
}
Best regards
wangji
Guys,
Im new with ser, but it seem great so far. The customer Im working with
want to get reliable CDRs from his SER SIP Server. He also has pre-paid
customers on it so it need to check to see if they have monies to make the
call, and when the call is done, it need to calculate and deduct the cost of
the call from their balance.
I have been using exec_msg command to try and do this, but I been having a
hard time getting it to work right because I get more then one invites and
acks. Also sometime they miss-dial and I only get Invites.
So I guess my is, are exec_msgs the right way to go? Is anyone else doing
the same thing, if so could you share you config with me?
-Greg
Voipin.com
#
# $Id: ser.cfg,v 1.21.2.1 2003/07/30 16:46:18 andrei Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters ------------------------
debug=4 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
/* Uncomment these lines to enter debugging mode
debug=7
fork=yes
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=yes
# ------------------ module loading ----------------------------------
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/exec.so"
loadmodule "/usr/local/lib/ser/modules/mysql.so"
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/uri.so"
#loadmodule "/usr/local/lib/ser/modules/group.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
modparam("usrloc","db_mode",2)
modparam("usrloc", "timer_interval", 30)
modparam("usrloc","db_url", "sql://ser:dc74uc@localhost/Tigris")
# -- auth params --
modparam("auth_db", "db_url", "sql://ser:dc74uc@localhost/Tigris")
# -- 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{
/* ********* ROUTINE CHECKS ********************************** */
# Take take of Max hops
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
break;
};
# Too big for a SIP msg.
if (len_gt( max_len )) {
sl_send_reply("513", "Message too big");
break;
};
# Authorize
if (method=="REGISTER")
{
if (!www_authorize("64.81.40.173", "subscriber")) {
www_challenge("64.81.40.173", "0");
log(1, "BAD REGISTER\n");
break;
};
save("location");
break;
};
exec_msg('`/root/bin/logcdr.pl`');
loose_route();
if (method=="INVITE")
{
record_route();
if (!exec_msg('`/root/bin/test.pl`'))
{
t_reply("404", "Low Funds");
break;
};
};
if (uri =~"^sip:[0-1]") {
if (uri =~"^sip:1666") {
rewritehostport("216.91.9.42:5060");
if (!t_relay()) { sl_reply_error(); };
break;
};
if (uri =~"^sip:1") {
rewritehostport("128.121.29.99:5060");
if (!t_relay()) { sl_reply_error(); };
break;
};
if (uri =~"^sip:011") {
rewritehostport("128.121.29.99:5060");
if (!t_relay()) { sl_reply_error(); };
break;
};
if (uri =~"^sip:00") {
strip(2);
prefix("011");
rewritehostport("128.121.29.99:5060");
if (!t_relay()) { sl_reply_error(); };
break;
};
} else {
if (!lookup("location")) {
sl_send_reply("404", "User Not Found");
log("SER: Dest User Not in location table.\n");
break;
};
if (!t_relay()) { sl_reply_error(); };
break;
};
}
Could someone please elaborate on this a bit more? I have looked through the last two months of the serusers archive and can't find any reference to it. What is the function of the 'ser automatic meeting systerm'? Is it documented? Available?
Thanks - Mike
At 03:33 AM 11/25/2003, you wrote:
>All the problems described to the mailing list were solvable.
>
>The completion of ser automatic meeting system construction was carried out.
>RedHat 9 + FreeRadius + PostgreSQL
>
> Ser 0.8.12 + Serweb All ok
>
>---------------------------
>voice lab inc. saitama japan.
>test call : sip:8700@voice.dyn.to
>test call : sip:8700@iptel.org
>---------------------------
>
>-----------------------
>voice lab inc. Saitama Japan.
>-----------------------
>
>Hello <sip:8001@iptel.org>,
>8200 <sip:8200@voice.dyn.to:5062>;tag=175262804 left a voice message for
>you.
>
>Thank you for using voice.dyn.to's Voicemail.
>
>Your voicemail system.
>
>---------------------------------------------------------
>This message was created by voice.dyn.to's voicemail system.
>Please review <http://www.voice.dyn.to>www.voice.dyn.to for more information.
>---------------------------------------------------------
>_______________________________________________
>Serusers mailing list
>serusers(a)lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers
i have a 6 line SIP phone. Its IP address is 192.168.1.159. Im placing a call
to 5555 ( another line on the same phone). I have set the proxy for both the
lines to my SERs IP address (192.168.1.240).I havent enabled register with
proxy on the phone but i tried that before and that gave me the same server
error as the one mentioned below.
These are the packets that i have captured while making the call. Now the
problem is that I am unable to understand the kind of internal
error it is giving.
18 6.670873 192.168.1.159 192.168.1.240 SIP/SDP
Request:
INVITE sip:5555@192.168.1.240, with session description
19 6.671179 192.168.1.240 192.168.1.159 SIP
Status:
100 trying -- your call is important to us
20 6.732622 192.168.1.240 192.168.1.159 SIP
Status:
500 I'm terribly sorry, server error occured (2/TM)
21 6.801520 192.168.1.159 192.168.1.240 SIP
Request: ACK sip:5555@192.168.1.240
Also the SIP message header of Packet 20 , as shown below, talks about warning
392. Does anyone know what warning it is?
FRAME 20:
Session Initiation Protocol
Status line: SIP/2.0 500 I'm terribly sorry, server error occured (2/TM)
Message Header
Via: SIP/2.0/UDP 192.168.1.159:5060
From: "in2"
<sip:in2@192.168.1.240>;tag=00036b3c33b500071afb6b0a-38f8c47a
To: <sip:5555@192.168.1.240>;tag=a6a1c5f60faecf035a1ae5b6e96e979a-188d
Call-ID: 00036b3c-33b50007-2047443d-0967cdd3(a)192.168.1.159
CSeq: 101 INVITE
Server: Sip EXpress router (0.8.11 (i386/linux))
Content-Length: 0
Warning: 392 192.168.1.240:5060 "Noisy feedback tells: pid=925
req_src_ip=192.168.1.240 req_src_port=5060 in_uri=sip:5555@192.168.1.240
out_uri=sip:5555@192.168.1.240 via_cnt==112"
I have attached my ser.sfg for your reference.
TIA,
Urvish Khandwalla
Hi,
I've been running a CVS version of ser recently with no problems, however I
wanted to move back to using a release version so have downloaded 0.8.12,
things seemed to be going OK, but it seems that SER crashes when my REGISTER
stuff attempts to do a save("location"), I am doing a check_to before that it
that works fine and queries the mysql backend no problems, I am using db_mode =
1 if that makes a difference, I tried using mode 2, which seemed to work but
then crashed later (presumably when trying to write to the db).
Nothing is ending up i the database and I am not seeing any INSERTs arriving
at the database server.
The error output I see after the check_to seems to work is....
11(3419) check_username(): From/To user '8540' and auth user match
11(3419) parse_headers: flags=-1
19(3427) BUG: tcp_main_loop: dead child 11
0(3408) child process 3419 exited by a signal 11
0(3408) core was not generated
0(3408) INFO: terminating due to SIGCHLD
1(3409) INFO: signal 15 received
1(3409) Memory status (pkg):
.....
--
Tristan Colgate
Inux Technologies
E-Mail: tristan(a)inuxtech.co.uk
Mobile: 07900 690 912
Hi,
I've installed ser-0.8.11 on FreeBSD via ports. Things run fine on a
private LAN. I have setup a pp2p tunnel, which shows up as ng1 in
FreeBSD's ifconfig. This allows Windows users at the remote end of the
tunnel to see the FreeBSD box just fine. The pp2p tunnel runs over a
NAT'ed, public IP address to another box which does the same thing.
However, NAT isn't (or shouldn't be) in the loop as the pp2p tunnel
hides all this. The public internet looks like one p2p link. I've
verified the above via tcpdump using many different applicationss.
Private addresses are used on both LAN's. Any box can see any box just
fine. On one FreeBSD machine, I am also running SER. It doesn't seem
to respond to the register SIP message. SER is listening ONLY to the ip
address that corresponds to its end of the pp2p tunnel.
Before I dig into what I might be doing wrong, I'd like to know if the
above is even supported.
Thanks,
MikeC
Hi,
I'm using ser-0.8.12 for SIP proxy and CISCO2651XM(12.2(11)T8) as
media gateway for PSTN.
When any subscriber call to PSTN via CISCO media gateway, CISCO
returns "SIP/2.0 183 Session Progress", and if caller hang up
before called party in PSTN pick up a call, CISCO send a packet of
"SIP/2.0 481 Call Leg/Transaction Does Not Exist" and call between
CISCO and PSTN called party is not hung up.
(Called party phone continue ringing)
(I consider that transaction before caller party pick up is not added
CISCO's transaction table.)
Could anyone please let me know how to terminate a call between
CISCO media gateway and called party in PSTN?
Regards,
--
- zaki - YAMAZAKI Noriyuki, Director of EDGE Co., Ltd.
+81-3-5749-9621(Phone), +81-3-5749-9910(Fax), zaki(a)edge.jp
Hello Daniel,
after changing the db url in the ser.cfg SER starts without any problem.
Now I will try to write some CPL scripts via CPLEd. One last question:
I'm not really sure where to place the cpl_run_script call in my SER
configuration. Do you have any advice for me? Many thanks again.
Regards,
Oliver
Daniel-Constantin Mierla wrote
>Hello,
>if you use the CVS head version then you should change the format of
>database url: Now it reflects the type of database used and for mysql
>should be like:
>
>mysql://foo:bar@localhost/ser
>
>Try with this one when setting the "cpl_db" parameter.
>
>Daniel
On 11/26/2003 11:30 AM, Brinker, Oliver wrote:
>Hi Bogdan,
>
>The mysql module is loaded before the cpl-c one. Please have a look into
>my ser.cfg because I cannot find any misconfig. Could it be a problem
>with the SQL connection string? MySQL should be running correct.
>
>I change the module name in the modparam declaration from cpl_c to cpl-c
>because cpl_c like in your documentation doesn't work ;) Thanks
>
>Oliver
>
>#
># $Id: ser.cfg,v 1.24 2003/11/11 15:32:36 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
>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/local/lib/ser/modules/mysql.so"
>
>loadmodule "/usr/local/lib/ser/modules/cpl-c.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"
>
># ----------------- 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)
>
># -- cpl-c module --
>modparam("cpl-c","cpl_db","sql://foo:bar@localhost/ser")
>modparam("cpl-c","cpl_table","cpl")
>modparam("cpl-c","cpl_dtd_file","/usr/local/etc/ser/cpl-06.dtd")
>modparam("cpl-c","log_dir","/var/log/ser/cpl")
>modparam("cpl-c","proxy_recurse",0)
>
># ------------------------- 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;
> };
>
> # 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("t-systems.com", "subscriber")) {
> www_challenge("t-systems.com", "0");
> break;
> };
>
> save("location");
> 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]
>{
> # send it out now; use stateful forwarding as it works reliably
> # even for UDP2TCP
> if (!t_relay()) {
> sl_reply_error();
> };
>}
>
>
>Bogdan-Andrei IANCU [mailto:iancu@fokus.fraunhofer.de] wrote
>
>
>
>>Hi Oliver,
>>
>>The mysql module must be loade before the cpl-c one. Make sure about
>>this in your configuration file.
>>
>>Bogdan
>>
>>
>
>Brinker, Oliver wrote:
>
>
>
>>Hi Bogdan,
>>now I fetch the whole cvs tree and compile SER and the needed modules.
>>Everything works fine until I put the cpl-c modparam values into ser.cfg.
>>I get an error message on my xconsole that the cpl-c module cannot bind
>>to the database. The mysql module is loaded because digest authentications
>>works since a few days. Is there anything to mind regarding the order of
>>loading modules or setting params in the ser.cfg? Many thanks.
>>
>>Regards,
>>Oliver
>>
>>
>>Bogdan-Andrei IANCU [mailto:iancu@fokus.fraunhofer.de] wrote
>>
>>
>>
>>
>>
>>>Hi Oliver,
>>>
>>>what branch of cvs do you use? or you use the head of cvs?
>>>on CVS head everything is fixed - but you have to get the whole tree,
>>>not only the TM.
>>>
>>>Regards,
>>>Bogdan
>>>
>>>
>>>
>>>
>>Brinker, Oliver wrote:
>>
>>
>>
>>
>>
>>>Hi Bogdan,
>>>
>>>I try to patch the TM module and get an error during patching t_reply.c:
>>>
>>>Hunk #2 FAILED at 375
>>>Hunk #3 FAILED at 400
>>>
>>>I'm not sure but could the faked_env function be the problem (expect four params,
>>>but receiving only two)? Should I use a new version of the TM module from the CVS?
>>>Many thanks.
>>>
>>>Regards,
>>>Olli
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Hello,
>>>>
>>>>In order to compile the cpl-c module, you need to apply a patch to the
>>>>tm_modulel you can finf this patch in modules/cpl-c/tm.patch.
>>>>Please, use the patch from the same version of ser as the tm modules. Try to do
>>>>so and let my know if it worked.
>>>>
>>>>Regards,
>>>>Bogdan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>_______________________________________________
>Serusers mailing list
>serusers(a)lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers
>
>
>
Thanks! :)
-----Original Message-----
From: Klaus Darilion [mailto:darilion@ict.tuwien.ac.at]
Sent: Wednesday, November 26, 2003 8:29 AM
To: Darren Sessions; serusers(a)lists.iptel.org
Subject: RE: [Serusers] Voicemail
You can find sample configuration files here:
http://iptel.org/~faqomatic/fom-serve/cache/92.html
<http://iptel.org/~faqomatic/fom-serve/cache/92.html>
Klaus
-----Original Message-----
From: Darren Sessions [mailto:dsessions@ionosphere.net]
Sent: Wednesday, November 26, 2003 2:04 PM
To: serusers(a)lists.iptel.org
Subject: [Serusers] Voicemail
Importance: High
Can someone provide me with the generic configuration for a SER box doing
call routing that forwards calls to a separate SER box running SEMS for
voice mail if the endpoint does not answer the phone?