<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>openSER and SEMS: pb with voicemail when phone is busy or on no answer</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi,</FONT><FONT FACE="Times New Roman"> </FONT>

<BR><FONT SIZE=2 FACE="Arial">I want to have voicemail feature when phone is busy or on no answer</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">My configuration file is like that:</FONT>
<UL>
<P><FONT SIZE=2 FACE="Arial">&#8230;.</FONT> 

<BR><FONT SIZE=2 FACE="Arial"># route block used only to have voicemail if phone is busy or on no answer</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">route[6] {</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; append_branch();</FONT><FONT FACE="Times New Roman"> </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&nbsp; avp_db_load(&quot;$ruri&quot;, &quot;$avp(email)/$email_scheme&quot;);</FONT><FONT FACE="Times New Roman"> </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&nbsp; if(!t_write_unix(&quot;/tmp/sems_socket&quot;, &quot;voicemail/voicemail_headers&quot;)) {</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; t_reply(&quot;500&quot;, &quot;error contacting sems&quot;);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; return;</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; }</FONT><FONT FACE="Times New Roman"> </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&nbsp; route(5);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; route(4);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; route(1);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">}</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">failure_route[1] {</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; # flagset 26 &lt;=&gt; if phone busy we want a voicemail</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; if ( (isflagset(26)) &amp;&amp; (t_check_status(&quot;486&quot;)) ) {</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; resetflag(26);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; route(6);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; return;</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; }</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">&nbsp; # flagset 27 &lt;=&gt; on no answer we want a voicemail</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp; if ( (isflagset(27)) &amp;&amp; (t_check_status(&quot;408&quot;)) ){</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; resetflag(27);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; route(6);</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp;&nbsp; return;</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">&nbsp;&nbsp; }</FONT><FONT FACE="Times New Roman"> </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&nbsp; end_media_session();</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Courier New">}</FONT><FONT FACE="Times New Roman"> </FONT>
</P>
</UL>
<P><FONT SIZE=2 FACE="Arial">Now if I use a &quot;default.template&quot; (used by the voicemail module)&nbsp; with the line:</FONT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">from:voicemail@%domain%, </FONT>
<BR>

<BR><FONT SIZE=2 FACE="Arial">SEMS cannot send correctly a email:</FONT><FONT FACE="Times New Roman"> </FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(3988) INFO: connect (AmSmtpClient.cpp:96): 127.0.0.1 welcomes us</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(3988) DEBUG: send_line (AmSmtpClient.cpp:173): SENDED: HELO 127.0.0.1</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(3988) DEBUG: read_line (AmSmtpClient.cpp:145): RECEIVED: 250 christophe.rv.fr</FONT><FONT FACE="Times New Roman"> </FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(3988) DEBUG: run (AmMail.cpp:119): Mail deamon starting its work</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(3988) DEBUG: send_line (AmSmtpClient.cpp:173): SENDED: mail from: &lt;voicemail@172.20.250.1&gt;</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(3988) DEBUG: read_line (AmSmtpClient.cpp:145): RECEIVED: 501 Bad address syntax</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">SEMS is trying to send a mail from &quot;voicemail@172.20.250.1&quot; ! The SMTP server doesn't accept an IP and this IP is the IP of the callee SIP device &#8230; Strange. It's important to notice that &quot;voicemail&quot; works fine when is used on a phone not registered with the line &quot;from:voicemail@%domain%&quot; in file &quot;default.template&quot; .</FONT></P>
<BR>

<P><FONT SIZE=2 FACE="Arial">In this case the SEMS log file is:</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(4494) INFO: connect (AmSmtpClient.cpp:96): 127.0.0.1 welcomes us</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(4494) DEBUG: send_line (AmSmtpClient.cpp:173): SENDED: HELO 127.0.0.1</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(4494) DEBUG: read_line (AmSmtpClient.cpp:145): RECEIVED: 250 christophe.rv.fr</FONT><FONT FACE="Times New Roman"> </FONT>

<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(4494) DEBUG: run (AmMail.cpp:119): Mail deamon starting its work</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(4494) DEBUG: send_line (AmSmtpClient.cpp:173): SENDED: mail from: &lt;voicemail@christophe.rv.fr&gt;</FONT><FONT FACE="Times New Roman"><BR>
</FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 FACE="Arial">(4494) DEBUG: read_line (AmSmtpClient.cpp:145): RECEIVED: 250 Ok</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">So I suspect the &quot;%domain%&quot; in &quot;default.template&quot; file is not correctly read by the module &quot;voicemail&quot; after a &quot;failure_route&quot; or after a &quot;append_branch&quot;.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">What I must change in my OpenSER configuration file in order to resolve this problem ?&nbsp;</FONT> 
</P>

<P><FONT SIZE=2 FACE="Arial">NOTE: I'm using sems-0.1.1 in revision 68</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thanks in advance,</FONT><FONT FACE="Times New Roman"><BR>
</FONT><FONT SIZE=2 FACE="Arial">Christophe</FONT><FONT FACE="Times New Roman"> </FONT>
</P>

</BODY>
</HTML>