<div dir="ltr"><div><div>OK, Daniel and thanks for your help,<br><br></div>I see that you don't append brach but you are calling route(RELAY) instead of t_relay() directly. I have tryed with this configuration within failure route:<br>
<br>if (t_check_status("486|408")) {<br>                <br>        #revert_uri();        <br>        prefix("voicemail");        <br>        remove_hf("P-App-Name");<br>        append_hf("P-App-Name: voicemail\r\n"); <br>
        append_hf("P-App-Param: mod=box;usr= $rU;dom=<a href="http://sipproxy.a.com">sipproxy.a.com</a>;uid=$rU;did=<a href="http://sipproxy.a.com">sipproxy.a.com</a>;\r\n");         <br>        rewritehostport("<a href="http://192.168.0.197:5080">192.168.0.197:5080</a>");<br>
        $du = $null;<br>        #append_branch();<br>        route(RELAY);<br>        #t_relay();<br>        <br>    }<br>}<br><br></div>And kamailio gets into a strange behavior<br><br>|Time     | 192.168.3.20                          | 192.168.0.167                         |<br>
|         |                   | 192.168.0.197     |                   <br>|3,366    |         INVITE SDP ( telephone-event)          |                   |SIP From: <a href="mailto:sip%3A4095@192.168.0.197">sip:4095@192.168.0.197</a> <a href="mailto:To%3Asip%3A4440@192.168.0.197">To:sip:4440@192.168.0.197</a><br>
|         |(5060)   ------------------>  (5060)   |                   |<br>|3,370    |         407 Proxy Authentication Required          |                   |SIP Status<br>|         |(5060)   <------------------  (5060)   |                   |<br>
|3,380    |         ACK       |                   |                   |SIP Request<br>|         |(5060)   ------------------>  (5060)   |                   |<br>|3,382    |         INVITE SDP ( telephone-event)          |                   |SIP From: <a href="mailto:sip%3A4095@192.168.0.197">sip:4095@192.168.0.197</a> <a href="mailto:To%3Asip%3A4440@192.168.0.197">To:sip:4440@192.168.0.197</a><br>
|         |(5060)   ------------------>  (5060)   |                   |<br>|3,393    |         100 trying -- your call is important to us          |                   |SIP Status<br>|         |(5060)   <------------------  (5060)   |                   |<br>
|3,394    |                   |         INVITE SDP ( telephone-event)          |SIP Request<br>|         |                   |(5060)   ------------------>  (5060)   |<br>|3,395    |                   |         100 Trying|                   |SIP Status<br>
|         |                   |(5060)   <------------------  (5060)   |<br>|3,395    |                   |         486 Busy Here                 |SIP Status<br>|         |                   |(5060)   <------------------  (5060)   |<br>
|3,398    |                   |         ACK       |                   |SIP Request<br>|         |                   |(5060)   ------------------>  (5060)   |<br>|3,416    |         500 I'm terribly sorry, server error occurred ...SL)          |                   |SIP Status<br>
|         |(5060)   <------------------  (5060)   |                   |<br>|3,416    |         486 Busy Here                 |                   |SIP Status<br>|         |(5060)   <------------------  (5060)   |                   |<br>
|3,418    |         ACK       |                   |                   |SIP Request<br>|         |(5060)   ------------------>  (5060)   |                   |<br>|3,418    |         ACK       |                   |                   |SIP Request<br>
|         |(5060)   ------------------>  (5060)   |                   |<br>|3,872    |         486 Busy Here                 |                   |SIP Status<br>|         |(5060)   <------------------  (5060)   |                   |<br>
|3,873    |         ACK       |                   |                   |SIP Request<br>|         |(5060)   ------------------>  (5060)   |                   |<br>|4,875    |         486 Busy Here                 |                   |SIP Status<br>
|         |(5060)   <------------------  (5060)   |                   |<br>|4,876    |         ACK       |                   |                   |SIP Request<br>|         |(5060)   ------------------>  (5060)   |                   |<br>
<div><br><br></div><div>Are you using this sequence within failure route? or in the call routing section? I'm using this sequence in the route section that is working OK:<br><br>if ($rU=~"^voicemail.*")  {<br>
        remove_hf("P-App-Name");<br>        append_hf("P-App-Name: voicemail\r\n"); <br>        append_hf("P-App-Param: mod=box;usr=$rU;dom=<a href="http://sipproxy.a.com">sipproxy.a.com</a>;uid=$rU;did=<a href="http://sipproxy.a.com">sipproxy.a.com</a>;\r\n"); <br>
        $ru = "sip:" + $rU + "@" + "<a href="http://192.168.0.197:5080">192.168.0.197:5080</a>"; <br>        route(RELAY); <br>        exit;<br>    }<br><br></div><div>The problem is when I try to get a call forwarded by kamailio to voice mail when it gets a busy message to the destination message. In your implementation are you expecting a 302 (temporary unavailable) message from the destination UAC?<br>
<br>Regards.<br><br></div><div>L.<br></div><div><br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/25 Daniel Tryba <span dir="ltr"><<a href="mailto:daniel@pocos.nl" target="_blank">daniel@pocos.nl</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thursday 25 July 2013 16:30:21 you wrote:<br>
<br>
> if (t_check_status("486|408")) {<br>
><br>
>         revert_uri();<br>
>         prefix("voicemail");<br>
>         remove_hf("P-App-Name");<br>
>         append_hf("P-App-Name: voicemail\r\n");<br>
>         append_hf("P-App-Param: mod=box;usr= $rU;dom=<a href="http://sipproxy.a.com" target="_blank">sipproxy.a.com</a><br>
> ;uid=$rU;did=<a href="http://sipproxy.a.com" target="_blank">sipproxy.a.com</a>;\r\n");<br>
>         rewritehostport("<a href="http://192.168.0.197:5080" target="_blank">192.168.0.197:5080</a>");<br>
>         $du = $null;<br>
>         #$du = "sip:192.168.0.197";<br>
>         #append_branch();<br>
>         t_relay();<br>
<br>
</div>Taking a look at my config which I found to work after the long struggle you<br>
are experiencing right now.<br>
<br>
if($avp(dst_voicemail))<br>
{<br>
  $du=$null;<br>
  $ru = "sip:tovm-" + $avp(dst_voicemail) + "@" +<br>
$sel(cfg_get.voicemail.srv_ip) + ":" + $sel(cfg_get.voicemail.srv_port);<br>
  route(RELAY);<br>
<br>
  exit;<br>
}<br>
<br>
Which effectively sets $du to null (if not null the message would get relayed<br>
to the original destination (the proxy itself)) and rewrites $ru to something<br>
like<br>
"sip:tovm-0123456789@voicemail:5060"<br>
and then just do the normal relay route to deliver the message. Your *_hf<br>
shouldn't have any effect on routing.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
<br>
POCOS B.V. - Croy 9c - 5653 LC Eindhoven<br>
Telefoon: 040 293 8661 - Fax: 040 293 8658<br>
<a href="http://www.pocos.nl/" target="_blank">http://www.pocos.nl/</a>   - <a href="http://www.sipo.nl/" target="_blank">http://www.sipo.nl/</a><br>
K.v.K. Eindhoven 17097024<br>
</div></div></blockquote></div><br></div>