<DIV>
<DIV>
<DIV><BR><BR><B><I>Quek Eric <inputdev@yahoo.com></I></B> wrote:
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">thx Steve,<BR>actually i dont quite understand e ser.cfg my previous<BR>project mate created.<BR>here i added tis portion into my ser.cfg...can u teach<BR>me where do i call t_on_failure?<BR><BR>if(method=="ACK" || method=="INVITE" || method=="BYE"|| method=="REFER")<BR>{<BR> if(t_newtran())<BR> {<BR> t_reply("100","Trying -- just wait a minute!");<BR><BR> if(method=="INVITE" || method=="REFER")<BR> {<BR> log("**************** vm start -begin
******************\n");<BR> if( uri =~ "conference" )<BR> {<BR><BR> if(!vm("/tmp/am_fifo","conference"))<BR> {<BR> log("could not contact conference
server\n");<BR><BR> t_reply("500","could not contact conference server");<BR> };<BR> }<BR> else if( uri =~ "echo" )<BR>
{<BR><BR> if(!vm("/tmp/am_fifo","echo"))<BR> {<BR> log("could not contact echo\n");<BR><BR> t_reply("500","could not contact
echo");<BR> };<BR> }<BR> else <BR> {<BR><BR>
if(!vm("/tmp/am_fifo","voicemail"))<BR> {<BR> log("could not contact voicemail\n");<BR><BR> t_reply("500","could not contact voicemail");<BR>
};<BR> };<BR><BR> log("**************** vm start - end ******************\n");<BR> break;<BR> };<BR><BR> if(method=="BYE")<BR> { <BR> log("**************** vm
end/refer - begin ******************\n");<BR><BR> if(!vm("/tmp/am_fifo","bye"))<BR> {<BR> log("could not contact the media server\n");<BR> t_reply("500","could not contact the media
server");<BR> };<BR><BR> log("**************** vm end/refer - end ********************\n");<BR> break;<BR> }; <BR> } <BR> else <BR> { <BR> log("could not create new transaction\n"); <BR><BR>
sl_send_reply("500","could not create new transaction");<BR> };<BR>};<BR># Voicemail specific configuration - end<BR><BR>Pls do help me...<BR>rgds,<BR>Eric <BR>Sure. Call t_on_failure("7") in route block 0, the<BR>main route block <BR>in <BR>SER. This<BR>will define an internal "flag" labeled 7. When the<BR>current call "fails" <BR>that is does not<BR>get a 200 OK message SER will look for a failure block<BR>with the label 7 <BR>and<BR>execute the code therein. Note that 7 is an arbitrary<BR>integer. You can <BR>pick whatever<BR>integer makes you happy and doesn't conflict with<BR>existing flags.<BR><BR>In the failure_route most people simply re-write the<BR>destination <BR>hostname and<BR>then t_relay the call to that new host. You may need<BR>to re-write the <BR>port number<BR>too. In either case this host and/or port is where<BR>your voicemail <BR>application is<BR>listening.<BR><BR>A failure_route is used instead of the regular
route<BR>statement <BR>because <BR>you want<BR>this section of code to be reached when a status code<BR>other than a 200 <BR>OK is<BR>received for a call. An unanswered call gets something<BR>like a 487 (you <BR>should<BR>check this for the actual number).<BR><BR>If you use SEMS you have yet another challenge. When<BR>SEMS was first <BR>deployed<BR>it communicated with SER used a fifo. Since the fifo<BR>is not a SIP <BR>addressable<BR>entity you needed a way for the failure_route to send<BR>SIP messages to <BR>SEMS.<BR>Most people used a second instance of SER on the same<BR>box but with a<BR>stripped down config file. This second instance could<BR>communicate with <BR>SEMS<BR>using a different named pipe.<BR><BR>Newer versions of SEMS do not have this limitation<BR>but you need to <BR>configure<BR>the type of interface SEMS will use. fifo or socket. I<BR>did one <BR>installation this<BR>way but then moved onto using Asterisk for voicemail.<BR><BR>Hope this
helps.<BR><BR>_Steve<BR><BR>__________________________________________________<BR>Do You Yahoo!?<BR>Tired of spam? Yahoo! Mail has the best spam protection around <BR>http://mail.yahoo.com <BR></BLOCKQUOTE></DIV></DIV></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com