<div dir="ltr"><div><div><div><div>Hola a todos,<br><br></div>Estoy tratando de configurar Kamailio 3.0.0 para que redirija las llamadas a un buzón de voz basado en SEMS cuando el usuario llamado está ocupado. Siguiendo las instrucciones de varios ejemplos encontrados en internet, y del propio script ejemplo de kamailio.cfg, estoy usando las funciones revert_uri(), rewritehostport() (o reescribiéndo el R-URI manualmente) y append_branch(), dentro de la failure_route. Aparentemente modifica correctamente el R-URI y crea la segunda "pata" de la llamada. Sin embargo, a pesar de que la dirección del R-Uri aparece bien cambiada como decía en la Request Line, el paquete IP se envía a la dirección IP del destinatario original:<br>
<br>|Time | 192.168.3.20 <div dir="ltr"> | 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" target="_blank">sip:4095@192.168.0.197</a> <a href="mailto:To%3Asip%3A4440@192.168.0.197" target="_blank">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" target="_blank">sip:4095@192.168.0.197</a> <a href="mailto:To%3Asip%3A4440@192.168.0.197" target="_blank">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></div><div>Esta es la captura del Invite de la redirección, en el timestamp 5,101<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" target="_blank">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" target="_blank">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" target="_blank">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=<div dir="ltr">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" target="_blank">sip:4095@192.168.3.20:5060</a>><br> Call-ID: <a href="mailto:8EAF9EC2-1DD2-11B2-B110-C84E476664B0@10.0.3.15" target="_blank">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" target="_blank">sip:4095@192.168.0.197</a>>;tag=121754238352072516<br> Max-Forwards: 69<br>
To: <<a href="mailto:sip%3A4440@192.168.0.197" target="_blank">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" target="_blank">sipproxy.a.com</a>;uid=voicemail4440;did=<a href="http://sipproxy.a.com" target="_blank">sipproxy.a.com</a>;<br>
Message Body</div><br></div><div dir="ltr"><br></div><div>La configuración que he usado es la siguiente:<br></div><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]")<div dir="ltr">
) {<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" target="_blank">sipproxy.a.com</a>;uid=$rU;did=<a href="http://sipproxy.a.com" target="_blank">sipproxy.a.com</a>;\r\n"); <br>
$ru = "sip:" + $rU + "@" + "<a href="http://192.168.0.197:5080" target="_blank">192.168.0.197:5080</a>";<br> #rewritehostport("<a href="http://192.168.0.197:5080" target="_blank">192.168.0.197:5080</a>");<br>
#append_branch("<a href="mailto:sip%3A4888@192.168.0.102" target="_blank">sip:4888@192.168.0.102</a>");<br> append_branch();<br> # do not set the missed call flag again<br> t_relay();<br>
}<br>}</div><br><br></div>¿Alguien ha tenido un problema similar? Cualquier ayuda será bienvenida.<br><br></div>Saludos.<br><br></div>LAA.<br></div>