[Serusers] SEMS IVR

Joao Sampaio est-j-sampaio at ptinovacao.pt
Wed Feb 4 14:09:09 CET 2004


Hello,

I'm trying to work with the IVR from SEMS.
I've looked to the example config file that is in the CVS and I realised
that is very similiar to the one that I have to Voicemail.
So, I just wrote other condition "If" in my Voicemail script so that SEMS
answers with IVR from requests to sip:ivr at domain

What is happening is that SEMS answer the call but them imediatly send a BYE
message and the call is terminated without no answer.

Does anybody had the some problem?

Here is is my Voicemail and Sems config file

Thanks.

Best regards,

João



#
# $Id: voicemail.cfg,v 1.2 2003/10/10 06:27:18 jiri Exp $
#
# this script is configured for use as voicemail UAS; it processes
# INVITEs and BYEs and asks SEMS to record media via "vm"; in this
# script, all record-routing and other constructs known from proxy
# scripts are not present  -- it is a simple UAS 
#

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

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

debug=4
#fork=no
log_stderror=yes
check_via=no		# (cmd. line: -v)
dns=no			# (cmd. line: -r)
rev_dns=no		# (cmd. line: -R)
port=5090
#children=4
fifo="/tmp/vm_ser_fifo"

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

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

modparam("voicemail", "db_url","mysql://ser:heslo@localhost/ser")

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

# main routing logic

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 (msg:len > max_len){                  #len_gt( max_len )) {
		sl_send_reply("513", "Message too big");
		break;
	};

	if (!uri==myself) {
		sl_send_reply("404", "not reponsible for host in r-uri");
		break;
	};


	# Voicemail specific configuration - begin

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

		if (!t_newtran()) 
		{
			log(1,"could not create new transaction\n");
			sl_send_reply("500","could not create new
transaction");
			break;
		};

		t_reply("100","Trying -- just wait a minute !");
		if(method=="INVITE")
		{
			log(1,"**************** vm start - begin
******************\n");
			if (uri=~"sip:9999 at 10.112.64.121")
			{ 
	               		if (!vm("/tmp/am_fifo", "announcement"))
				 {
			       		log(1,"couldn't contact announcement
server\n");
					t_reply("500", "couldn not contact
announcement server");
				};
	
log("!!!!!!!!!!!!!!!!!!!!!ANNOUNCEMENT!!!!!!!!!!!!!!!!!!!!!!\n");
			}
			else  if(uri=~"sip:ivr at 10.112.64.121")
			{
				if (!vm("/tmp/am_fifo", "ivr"))
				{
					log("could not contact ivr
server\n");
					t_reply("500","could not contact ivr
server");
				};
				log
("!!!!!!!!!!!!!!!!!!!!!!!!!IVR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
			}
			else if (uri=~"sip:conf at 10.112.64.121")
			{
				if (!vm("/tmp/am_fifo", "conference"))
				{
					log("Could not contact conference
server\n");
					t_reply("500","Could not contact
conference server");
				};
				log
("!!!!!!!!!!!!!!!!!!!!!CONFERENCE!!!!!!!!!!!!!!!!!!!!!!!!!\n");
			}			
			else 
			{
				if(!vm("/tmp/am_fifo","voicemail"))
				{
					log(1,"could not contact the answer
machine\n");
					t_reply("500","could not contact the
answer machine");
				};
	
log("!!!!!!!!!!!!!!!!!!!!!!VOICEMAIL!!!!!!!!!!!!!!!!!!!!!!!!!\n");
			};
			log(1,"**************** vm start - end
******************\n");
		} 
		else if(method=="BYE")
		{
			log(1,"**************** vm end - begin
******************\n");
			if(!vm("/tmp/am_fifo","bye"))
			{
				log(1,"could not contact the answer
machine\n");
				t_reply("500","could not contact the answer
machine");
			};
			log(1,"**************** vm end - end
******************\n");
		};
		break;
	};
	if (method=="CANCEL") 
	{
		sl_send_reply("200", "cancels are junked here");
		break;
	};
	sl_send_reply("501", "method not understood here");
}


----------------------------------------------------------------------------
---------------------------------------------------


# $Id: sems.conf.sample,v 1.11 2003/11/19 19:03:22 rco Exp $
#
# sems.conf.sample
#
# Sip Express Media Server (sems)
# 
# 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=no is the same as -E)
fork=yes

# optional parameter: stderr={yes|no}
#
# - debug mode: do not fork and log to stderr
#   (stderr=yes is the same as -E)
stderr=no

# optional parameter: loglevel={0|1|2|3}
#
# - sets log level (error=0, warning=1, info=2, debug=3)
#   (same as -D)
loglevel=1

# optional parameter: fifo_name=<filename>
#
# - path and file name of our fifo file (same as -i)
fifo_name=/tmp/am_fifo

# optional parameter: ser_fifo_name=<filename>
#
# - path and file name of Ser's fifo file (same as -o)
ser_fifo_name=/tmp/vm_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/

# 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


##################################
# module specific parameters     #
##################################

# sample voicemail configuration (inline)
config.voicemail=inline

# optional parameter: announce_path=<path>
# 
# - sets the path where announce files are searched for
# - the file to be played is determined the following way:
#   <announce_path>/<domainname>/<username>.wav
#   if this file is not available <announce_path>/<default_anounce> is used
announce_path=/usr/local/lib/sems/audio/

# parameter: default_announce=<filename>
# 
# - sets the name of the default announce WAV file
default_announce=default_en.wav

# parameter: max_record_time=<seconds>
#
# - maximum record time
max_record_time=30

# end of configuration section for voicemail module
config.voicemail=end


# sample announcement configuration (inline)
config.announcement=inline

# optional parameter: announce_path=<path>
# 
# - sets the path where announce files are searched for
announce_path=/usr/local/lib/sems/audio/

# parameter: default_announce=<filename>
# 
# - sets the name of the default announce WAV file
default_announce=welcome_to_number_reader.wav   #default_en.wav

# end of configuration section for announcement module
config.announcement=end


# sample isdngw module configuration (external file)
# config.isdngw=/etc/isdngw.conf

# sample ivr module configuration (inline)
config.ivr=inline

#parameter: python_script_path=<full path>
python_script_path=/etc/ivr

#parameter: python_script_file=<filename>
python_script_file=ivr.py #example.py

# end of configuration section for ivr module
config.ivr=end


# sample conference configuration (inline)
config.conference=inline

# parameter: default_announce=<filename>
#
# - sets the full pathed name of the default announce WAV file.
#   Will be played to lonely users.
default_announce=/usr/local/lib/sems/audio/first_participant.wav

# end of configuration section for conference module
config.conference=end

# example configuration for number reader
config.number_reader=inline

#number_path=wav
number_path=/usr/local/lib/sems/audio

prolog_file=welcome_to_number_reader.wav

epilog_file=thanks_calling_number_reader.wav

# end of number_reader configuration
config.number_reader=end

# add more module configurations here (inline or external):
#
# config.mymodule=<filename>
#  or
# config.mymodule=inline
# ...
# config.mymodule=end




 



________________________
João Sampaio

PT Inovação, SA

SRM - Serviços e Redes Móveis

email: est-j-sampaio at ptinovacao.pt
Tlf:  +351 234511160-1907 / +351 234403421

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20040204/0fc07ee5/attachment.htm>


More information about the sr-users mailing list