[Serusers] How to enable my Voice Mail in ser.cfg

Quek Eric inputdev at yahoo.com
Wed Apr 6 03:03:08 CEST 2005


thx Steve,
actually i dont quite understand e ser.cfg my previous
project mate created.
here i added tis portion into my ser.cfg...can u teach
me where do i call t_on_failure?

if(method=="ACK" || method=="INVITE" || method=="BYE"
|| method=="REFER")
		{
			if(t_newtran())
			{
		        	t_reply("100","Trying -- just wait a minute
!");

        			if(method=="INVITE" || method=="REFER")
				{
                			log("**************** vm start -
begin ******************\n");
                			if( uri =~ "conference" )
					{
                        		
if(!vm("/tmp/am_fifo","conference"))
						{
							log("could not contact conference server\n");
                                        	
t_reply("500","could not contact conference server");
                                		};
                        		}
                        		else if( uri =~ "echo" )
					{
                        		
if(!vm("/tmp/am_fifo","echo"))
						{
                                			log("could not
contact echo\n");
                                        	
t_reply("500","could not contact echo");
                                		};
                        		}
                        		else 
					{
                        		
if(!vm("/tmp/am_fifo","voicemail"))
						{
                        				log("could not contact
voicemail\n");
                                		
t_reply("500","could not contact voicemail");
                                		};
                        		};
                                        
					log("**************** vm start - end
******************\n");
                        		break;
                		};
                                
                		if(method=="BYE")
				{       
					log("**************** vm end/refer - begin
******************\n");
                                        
					if(!vm("/tmp/am_fifo","bye"))
					{
					log("could not contact the media server\n");
                                	t_reply("500","could
not contact the media server");
                        		};
                                        
					log("**************** vm end/refer - end
********************\n");
                        		break;
                		};                
			}                
			else 
			{             
				log("could not create new transaction\n");        
    
				sl_send_reply("500","could not create new
transaction");
        		};
		};
# Voicemail specific configuration - end

Pls do help me...
rgds,
Eric  
Sure. Call t_on_failure("7") in route block 0, the
main route block 
in 
SER. This
will define an internal "flag" labeled 7. When the
current call "fails" 
that is does not
get a 200 OK message SER will look for a failure block
with the label 7 
and
execute the code therein. Note that 7 is an arbitrary
integer. You can 
pick whatever
integer makes you happy and doesn't conflict with
existing flags.

  In the failure_route most people simply re-write the
destination 
hostname and
then t_relay the call to that new host. You may need
to re-write the 
port number
too. In either case this host and/or port is where
your voicemail 
application is
listening.

  A failure_route is used instead of the regular route
statement 
because 
you want
this section of code to be reached when a status code
other than a 200 
OK is
received for a call. An unanswered call gets something
like a 487 (you 
should
check this for the actual number).

  If you use SEMS you have yet another challenge. When
SEMS was first 
deployed
it communicated with SER used a fifo. Since the fifo
is not a SIP 
addressable
entity you needed a way for the failure_route to send
SIP messages to 
SEMS.
Most people used a second instance of SER on the same
box but with a
stripped down config file. This second instance could
communicate with 
SEMS
using a different named pipe.

  Newer versions of SEMS do not have this limitation
but you need to 
configure
the type of interface SEMS will use. fifo or socket. I
did one 
installation this
way but then moved onto using Asterisk for voicemail.

  Hope this helps.

_Steve

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the sr-users mailing list