[Serusers] Voicemail implementation

Jan Janak jan at iptel.org
Thu Jul 24 23:32:16 CEST 2003

Hello, comments inline.

On 24-07 16:45, Juan J. Sierralta P. wrote:
> On Thu, 2003-07-24 at 16:17, Jan Janak wrote:
> > > 	First of all thanks to SER developers for the great work.
> > > 	I'm new to SIP and SER, I been playing with it a week ago and I was
> > > able to setup a 0.8.11pre, and now I want to try the voicemail service.
> > > It seems that I need to run another SER instance for voicemail and
> > > redirect the requests to that instance.
> > 
> >   No, you can run it on the same server.
> > 
> > > 	It is posible to process the voicemail request on the same instance I
> > > use to forward/register users ?
> > 
> >    Yes.
> > 
> > > 	Or I need a second SER running. In case of 2 SER servers, it is posible
> > > to run them in the same box using diferent ports and diferent databases
> > > ?
> > 
> >   Yes, if the servers listen on different ports and use different
> >   databases.
> 	The problem I see with two instances is maintaing the users table
> syncronized to get the email address.

    You can use the same table as for the "routing" SIP server.
    subscriber table (the table which contains usernames and
    correspondings e-mails) is not modified by the proxy or voicemail,
    so there is no need to synchronize it.

    I mean the routing proxy will query the table to get credentials and
    voicemail will query it to get email addresses.

> 	So is there an example out there how to implement voicemail in the same
> instance used for forwarding/register.

   A sample config file for a voicemail running within another ser
   instance is attached. Note that you can also put the snippets of the
   config into the main proxy config, you need no separate instance.

> 	Correct me if I'm wrong:
> 	- I receive an INVITE for an offline user.
> 	- I detect the offline status and must rewrite the uri in some 	way to
> signal echo,conference or voicemail.
> 	The problem I see if I rewrite the URI the VM will no be able to locate
> the user's email address.

   It uses To header field to get URI of the callee, To header
   field URI never changes.


PS: Please always CC the list.

-------------- next part --------------
# $Id: ser.cfg,v 1.10 2003/04/27 12:10:14 rco Exp $
# iptel's voicemail config script

# ----------- global configuration parameters ------------------------

#debug=7		        # debug level (cmd line: -dddddddddd)
#log_stderror=yes 	# (cmd line: -E)

debug=3		        # debug level (cmd line: -dddddddddd)

log_stderror=no 	# (cmd line: -E)
check_via=no		# (cmd. line: -v)
dns=no			# (cmd. line: -r)
rev_dns=no		# (cmd. line: -R)

# ------------------ module loading ----------------------------------

loadmodule "/usr/local/lib/ser/modules/dbtext/dbtext.so"
loadmodule "/usr/local/lib/ser/modules/sl/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm/tm.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/mysql/mysql.so"
loadmodule "/usr/local/lib/ser/modules/rr/rr.so"
loadmodule "/usr/local/lib/ser/modules/textops/textops.so"
loadmodule "/usr/local/lib/ser/modules/vm/vm.so"
# ----------------- setting module-specific parameters ---------------

modparam("voicemail", "db_url","sql://ser:heslo@dbhost/ser")

# -------------------------  request routing logic -------------------

# main routing logic


	# 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");
	if (len_gt( max_len )) {
		sl_send_reply("513", "Message too big");

	# 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
	# loose-route processing

	# Make MSN Messenger happy... 
	if (method=="REGISTER") {


		# Voicemail specific configuration - begin

		if(method=="ACK" || method=="INVITE" || method=="BYE"){


				t_reply("100","Trying -- just wait a minute !");

					log("**************** vm start - begin ******************\n");
						log("could not contact the answer machine\n");
						t_reply("500","could not contact the answer machine");
					log("**************** vm start - end ******************\n");

					log("**************** vm end - begin ******************\n");
						log("could not contact the answer machine\n");
						t_reply("500","could not contact the answer machine");
					log("**************** vm end - end ******************\n");
			else {
			     log("could not create new transaction\n");
			     sl_send_reply("500","could not create new transaction");

		# Voicemail specific configuration - end

More information about the sr-users mailing list