<div dir="ltr">Hi all,<br><br>I'm running Kamailio 3.0.0, with SEMS integration as Media Server for Voice mail. I'm trying to get a configuration to forward calls on busy to voice mail. I have followed without success some examples. I'm using revert_uri(), rewritehostport() and append_branch(), within failure_route. It seems to be modifying R-URI properly, and generating the new branch, but Kamailio is sending the new invite packet to the IP address of the original destination UAC, and not to the IP address of the voicemail, that was indicated in the R-URI. Here you can see the packet flow:<br>
<br>|Time     | 192.168.3.20                  <br>        | 192.168.0.167                         |<br>|         |                   | 192.168.0.197     |                  <br>|5,069    |         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>|5,071    |         407 Proxy Authentication Required          |                   |SIP Status<br>|         |(5060)   <------------------  (5060)   |                   |<br>
|5,074    |         ACK       |                   |                   |SIP Request<br>|         |(5060)   ------------------>  (5060)   |                   |<br>|5,076    |         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>|5,084    |         100 trying -- your call is important to us          |                   |SIP Status<br>|         |(5060)   <------------------  (5060)   |                   |<br>
|5,085    |                   |         INVITE SDP ( telephone-event)          |SIP Request<br>|         |                   |(5060)   ------------------>  (5060)   |<br>|5,088    |                   |         100 Trying|                   |SIP Status<br>
|         |                   |(5060)   <------------------  (5060)   |<br>|5,088    |                   |         486 Busy Here                 |SIP Status<br>|         |                   |(5060)   <------------------  (5060)   |<br>
|5,091    |                   |         ACK       |                   |SIP Request<br>|         |                   |(5060)   ------------------>  (5060)   |<br>|5,101    |                   |         INVITE SDP ( telephone-event)          |SIP Request<br>
|         |                   |(5060)   ------------------>  (5060)   |<br>|5,102    |                   |         404 Not Found                 |SIP Status<br>|         |                   |(5060)   <------------------  (5060)   |<br>
|5,102    |                   |         ACK       |                   |SIP Request<br>|         |                   |(5060)   ------------------>  (5060)   |<br>|5,103    |         404 Not Found                 |                   |SIP Status<br>
|         |(5060)   <------------------  (5060)   |                   |<br>|5,106    |         ACK       |                   |                   |SIP Request<br>|         |(5060)   ------------------>  (5060)   |                   |<br>
<br>And the RAW capture of the INVITE message in timestamp 5,101.<br><br><br><br>No.     Time        Source                Destination           Protocol Info<br>   1235 5.100698    192.168.0.197         192.168.0.167         SIP/SDP  Request: INVITE <a href="http://sip:voicemail4440@192.168.0.197:5080">sip:voicemail4440@192.168.0.197:5080</a>, with session description<br>
<br>Frame 1235 (1151 bytes on wire, 1151 bytes captured)<br>Ethernet II, Src: CadmusCo_96:31:84 (08:00:27:96:31:84), Dst: Micro-St_6d:77:54 (00:21:85:6d:77:54)<br>Internet Protocol, Src: 192.168.0.197 (192.168.0.197), Dst: 192.168.0.167 (192.168.0.167)<br>
User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)<br>Session Initiation Protocol<br>    Request-Line: INVITE <a href="http://sip:voicemail4440@192.168.0.197:5080">sip:voicemail4440@192.168.0.197:5080</a> SIP/2.0<br>
        Method: INVITE<br>        Request-URI: <a href="http://sip:voicemail4440@192.168.0.197:5080">sip:voicemail4440@192.168.0.197:5080</a><br>        [Resent Packet: True]<br>        [Suspected resend of frame: 1233]<br>
    Message Header<br>        Record-Route: <sip:192.168.0.197;lr=on;nat=<br>yes><br>        Via: SIP/2.0/UDP 192.168.0.197;branch=z9hG4bKafce.403718a6.1<br>        Via: SIP/2.0/UDP 192.168.57.20;received=192.168.3.20;rport=5060;branch=z9hG4bK0a00030f0000003151ed60b85ec2c3de000000c8<br>
        Content-Length: 386<br>        Contact: <<a href="http://sip:4095@192.168.3.20:5060">sip:4095@192.168.3.20:5060</a>><br>        Call-ID: <a href="mailto:8EAF9EC2-1DD2-11B2-B110-C84E476664B0@10.0.3.15">8EAF9EC2-1DD2-11B2-B110-C84E476664B0@10.0.3.15</a><br>
        Content-Type: application/sdp<br>        CSeq: 2 INVITE<br>        From: "4095"<<a href="mailto:sip%3A4095@192.168.0.197">sip:4095@192.168.0.197</a>>;tag=121754238352072516<br>        Max-Forwards: 69<br>
        To: <<a href="mailto:sip%3A4440@192.168.0.197">sip:4440@192.168.0.197</a>><br>        User-Agent: SJphone/1.60.299a/L (SJ Labs)<br>        P-App-Name: voicemail<br>        P-App-Param: mod=box;usr= voicemail4440;dom=<a href="http://sipproxy.a.com">sipproxy.a.com</a>;uid=voicemail4440;did=<a href="http://sipproxy.a.com">sipproxy.a.com</a>;<br>
    Message Body<br><br>Here you can see the failure_route in my kamailio.cfg file:<br><br># Sample failure route<br>failure_route[FAIL_ONE] {<br>#ifdef WITH_NAT<br>    if (is_method("INVITE")<br>            && (isbflagset("6") || isflagset(5))) {<br>
        unforce_rtp_proxy();<br>    }<br>#endif<br><br>    if (t_is_canceled()) {<br>        exit;<br>    }<br><br>    # uncomment the following lines if you want to block client<br>    # redirect based on 3xx replies.<br>
    ##if (t_check_status("3[0-9][0-9]")<br>) {<br>    ##t_reply("404","Not found");<br>    ##    exit;<br>    ##}<br><br>    # uncomment the following lines if you want to redirect the failed<br>
    # calls to a different new destination<br>    if (t_check_status("486|408")) {<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>        $ru = "sip:" + $rU + "@" + "<a href="http://192.168.0.197:5080">192.168.0.197:5080</a>";<br>
        #rewritehostport("<a href="http://192.168.0.197:5080">192.168.0.197:5080</a>");<br>        #append_branch("<a href="mailto:sip%3A4888@192.168.0.102">sip:4888@192.168.0.102</a>");<br>        append_branch();<br>
        # do not set the missed call flag again<br>        t_relay();<br>    }<br>}<br><br>Has anybody experienced this problem? Any help would be wellcome<br><br>Best Regards<br><br>LAA<br></div>