We support multi-ser instances per machine. We use ipaliases, eg:
/sbin/ifconfig eth0:0 10.2.1.10 netmask 255.255.255.255 up /sbin/route add 10.2.1.10 dev eth0:0
we then make a directory:
mkdir /tmp/ser_fifo
Then the top of each configuration file:
debug=2 log_stderror=no listen=10.2.1.10 port=5060 children=4
fifo="/tmp/ser_fifo/unique.com" alias="unique.com" alias="proxy.unique.com" alias="nat.unique.com" alias="10.2.1.10"
Then start the thing with ser -f unique.com.cfg
where unique.com.cfg is the file above...YMMV unique.com is not a real site, just a name placeholder...
If you are using mysql you will get TONS of dbopens, the old postgres also does TONS of opens. I hacked my SER to wait on the dbopen. I've attempted a couple of times to check in the hacked code but always run into problems (operator I'm sure).
I can send you the modified postgres code if you are using that, otherwise, there may be an issue with the number of open db connections if you start more than a couple. I currently have about 8 ser instances running on a single box, with only 16 db connections between them.
My experience with multiple servers on a single box has been mixed. The main thing is debugging is more difficult. You have to capture traffic from the lo (loopback) interface as well as the ethernet interface, looking at two ngrep traces can be confusing.
I like to use tcpdump or ethereal to capture and look at sipscene traces, this is impossible with loopback. I have tried everything to merge (tethereal, mergecap, etc) a loopback capture and a ethernet capture, they don't mix!
What I ended up having to do was put servers on separate boxes so I can capture the traces to debug! So I keep:
external servers (inbound/outbound pstn/sip/enum) on a set of boxes. external interfaces (proxy/registration servers for customers) on a set of boxes. voicemail / media servers on a set of boxes.
I then use a cisco switch/port monitoring to give me a sniffable feed to do packet traces. I highly recommend getting traces to work, otherwise, debugging is a major pain!
Good luck,
---greg
Daniel-Constantin Mierla wrote:
Hello, you must set a different port for each instance (within config files or using command line options) and, also, strong recommended, different fifo files.
You have to duplicate serctl and change one to use the other fifo file. I am not aware of serctl supporting many fifo files in the same time, but I might be wrong.
Also, you can start ser from console providing as parameter which config file to use with 'ser -f /path/to/config/file'. 'ser -h' lists all command line parameters.
Daniel
On 1/13/2004 6:48 PM, Srbislav Cvetkovic wrote:
HI guys,
I have a qustion. How do you start two instances of ser on one host? serctl help does not have that option listed.
thanks, On Tuesday, January 13, 2004, at 04:53 AM, Jan Janak wrote:
Regarding your config, if you want the call to be redirected to voicemail when the callee is not registered (instead of getting 404), you should redirect the call to voicemail in the if (!lookup("location")) condition. The condition will be true if the callee is not registered.
Yes, it is strange that you don't have system logs in /var/log.
Jan.
On 12-01 14:57, Srbislav Cvetkovic wrote:
Hi to all,
I am new to ser and sems. I was able to setup ser on openbsd and make a call from one user agent to another. Then I installed sems and after some playing around i was able to make it work with ser. However now the call is being directed to my voicemail system and the phone does not ring at all. Is there a setting that will allow me to set up the number of rings before it gets redirected to my voicemail? Below are my ser.cfg and sems.conf files.
I have mysql version of ser working. Also there is one problem. I have no log files for some reason. From the documentation that I 've read it says that it should be in system log file. I have no system log file in /var/log . Isn't that strange? I successfuly receive all of my voice messages though.
////////////////////// ser.cfg
route{
# initial sanity checks -- messages with # max_forwars==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 loose_route(); # Make MSN Messenger happy... if (method=="REGISTER") { sl_send_reply("200","ok"); break; }; if (uri == myself) { if (method=="REGISTER") { # Uncomment this if you want to use digest
authentication if (!www_authorize("myhost.com", "subscriber")) { www_challenge("myhost.com", "0"); break; };
save("location"); break; }; /* # if i comment this out then the call is being redirected to my voicemail # if it's not commented out, then I get 404 User Not Found error while dialing # native SIP destinations are handled using our USRLOC
DB if (!lookup("location")) { sl_send_reply("404", "Not Found"); break; }; */
# Voicemail specific configuration - begin if(method=="ACK" || method=="INVITE" || method=="BYE"){ if(t_newtran()){ t_reply("100","Trying -- just wait a
minute !");
if(method=="INVITE"){ log("**************** vm start
- begin *
*****************\n");
if(!vm("/tmp/am_fifo","voicemail")){ log("could not contact the answe r machine\n"); t_reply("500","could not contact the answer machine"); }; log("**************** vm start
- end ***
***************\n"); break; };
if(method=="BYE"){ log("**************** vm end -
begin *** ***************\n"); if(!vm("/tmp/am_fifo","bye")){ log("could not contact the answe r machine\n"); t_reply("500","could not contact the answer machine"); }; log("**************** vm end - end ***** *************\n"); break; }; } else { log("could not create new transaction\n"); sl_send_reply("500","could not create new transacti on"); }; };
# Voicemail specific configuration - end }; # 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(); };
}
//////////////////////// sems.conf
# # sample configuration file # # # whitespaces (spaces and tabs) are ignored # comments start with a "#" and may be used inline # # example: option=value1, value2 # i like this option #
################################## # global parameters # ##################################
# optional parameter: fork={yes|no} # # - specifies if sems should run in daemon mode (background) fork=yes
# optional parameter: stderr={yes|no} # # - debug mode: do not fork and log to stderr stderr=no
# optional parameter: loglevel={0|1|2|3} # # - sets log level (error=0, warning=1, info=2, debug=3) loglevel=1
# optional parameter: fifo_name=<filename> # # - path and file name of our fifo file fifo_name=/tmp/am_fifo
# optional parameter: ser_fifo_name=<filename> # # - path and file name of Ser's fifo file ser_fifo_name=/tmp/ser_fifo
# optional parameter: plugin_path=<path> # # - sets the path to the plug-ins # - may be absolute or relative to CWD plugin_path=/usr/local/lib/sems/plug-in/
################################## # voicemail specific parameters # ##################################
# optional parameter: announce_path=<path> # # - sets the path where announce files are searched for announce_path=/usr/local/lib/sems/audio/
# optional parameter: default_announce=<filename> # # - sets the name of the default announce WAV file default_announce=default_en.wav
# optional parameter: max_record=<seconds> # # - maximum record time max_record=30
# optional parameter: smtp_server=<hostname> # # - sets address of smtp server smtp_server=localhost
# optional parameter: smtp_port=<port> # # - sets port of smtp server smtp_port=25
Thanks,
Srbo Cvetkovic | CityNet, Inc. srbo@city-net.com | Pittsburgh, PA voice: 412.481.5406 | fax: 412.431.1315
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Srbo Cvetkovic | CityNet, Inc. srbo@city-net.com | Pittsburgh, PA voice: 412.481.5406 | fax: 412.431.1315
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers