Hello Hero,
Thanks for your help.
May be I'm loosing something. I have changed my config as you suggested (I thing so...):
if (t_check_status("486|408")) {
revert_uri(); prefix("voicemail"); remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n");
append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com;uid=$
rU;did=sipproxy.a.com;\r\n"); rewritehostport("192.168.0.197:5080"); $du = $null; #$du = "sip:192.168.0.197"; append_branch(); t_relay();
} }
Kamailio sends back 200 OK to the UAC that originated the call, but it never sends the new INVITE
|Time | 192.168.3.20
| 192.168.0.167 | | | | 192.168.0.197 | |3,151 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,159 | 407 Proxy Authentication Required | |SIP Status | |(5060) <------------------ (5060) | | |3,161 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,161 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,174 | 100 trying -- your call is important to us | |SIP Status | |(5060) <------------------ (5060) | | |3,174 | | INVITE SDP ( telephone-event) |SIP Request | | |(5060) ------------------> (5060) | |3,176 | | 100 Trying| |SIP Status | | |(5060) <------------------ (5060) | |3,177 | | 486 Busy Here |SIP Status | | |(5060) <------------------ (5060) | |3,180 | | ACK | |SIP Request | | |(5060) ------------------> (5060) | |3,195 | 200 OK SDP ( telephone-event) | |SIP Status | |(5060) <------------------ (5060) | | |3,200 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,213 | RTP (GSM) | | |RTP Num packets:204 Duration:4.069s SSRC:0x8494958 | |(49222) ------------------> (10028) | | |7,288 | BYE | | |SIP Request | |(5060) ------------------> (5060) | | |7,295 | 200 OK | | |SIP Status | |(5060) <------------------ (5060) | |
what am I loosing?
Regards
LAA
*************
had the same issue here. you have to manually set $du=$null, else it doesn't get reset for the failure branch.
On 7/23/13, LAA <ornitorrinco7424 at gmail.com http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users> wrote:
- Hi all,*>**>* 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:*>**>* |Time | 192.168.3.20*>* | 192.168.0.167 |*>* | | | 192.168.0.197 |*>* |5,069 | INVITE SDP ( telephone-event)*>* | |SIP From: sip:4095 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users*>* To:sip:4440 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users*>* | |(5060) ------------------> (5060) | |*>* |5,071 | 407 Proxy Authentication Required*>* | |SIP Status*>* | |(5060) <------------------ (5060) | |*>* |5,074 | ACK | | |SIP*>* Request*>* | |(5060) ------------------> (5060) | |*>* |5,076 | INVITE SDP ( telephone-event)*>* | |SIP From: sip:4095 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users*>* To:sip:4440 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users*>* | |(5060) ------------------> (5060) | |*>* |5,084 | 100 trying -- your call is important to us*>* | |SIP Status*>* | |(5060) <------------------ (5060) | |*>* |5,085 | | INVITE SDP (*>* telephone-event) |SIP Request*>* | | |(5060) ------------------> (5060) |*>* |5,088 | | 100 Trying| |SIP*>* Status*>* | | |(5060) <------------------ (5060) |*>* |5,088 | | 486 Busy Here |SIP*>* Status*>* | | |(5060) <------------------ (5060) |*>* |5,091 | | ACK | |SIP*>* Request*>* | | |(5060) ------------------> (5060) |*>* |5,101 | | INVITE SDP (*>* telephone-event) |SIP Request*>* | | |(5060) ------------------> (5060) |*>* |5,102 | | 404 Not Found |SIP*>* Status*>* | | |(5060) <------------------ (5060) |*>* |5,102 | | ACK | |SIP*>* Request*>* | | |(5060) ------------------> (5060) |*>* |5,103 | 404 Not Found | |SIP*>* Status*>* | |(5060) <------------------ (5060) | |*>* |5,106 | ACK | | |SIP*>* Request*>* | |(5060) ------------------> (5060) | |*>**>* And the RAW capture of the INVITE message in timestamp 5,101.*>**>**>**>* No. Time Source Destination Protocol*>* Info*>* 1235 5.100698 192.168.0.197 192.168.0.167 SIP/SDP*>* Request: INVITE sip:voicemail4440 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users:5080, with session*>* description*>**>* Frame 1235 (1151 bytes on wire, 1151 bytes captured)*>* 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)*>* Internet Protocol, Src: 192.168.0.197 (192.168.0.197), Dst: 192.168.0.167*>* (192.168.0.167)*>* User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)*>* Session Initiation Protocol*>* Request-Line: INVITE sip:voicemail4440 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users:5080 SIP/2.0*>* Method: INVITE*>* Request-URI: sip:voicemail4440 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users:5080*>* [Resent Packet: True]*>* [Suspected resend of frame: 1233]*>* Message Header*>* Record-Route: sip:192.168.0.197;lr=on;nat=** yes>*>* Via: SIP/2.0/UDP 192.168.0.197;branch=z9hG4bKafce.403718a6.1*>* Via: SIP/2.0/UDP*>* 192.168.57.20;received=192.168.3.20;rport=5060;branch=z9hG4bK0a00030f0000003151ed60b85ec2c3de000000c8*>* Content-Length: 386*>* Contact: <sip:4095 at 192.168.3.20 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users:5060>*>* Call-ID: 8EAF9EC2-1DD2-11B2-B110-C84E476664B0 at 10.0.3.15 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users*>* Content-Type: application/sdp*>* CSeq: 2 INVITE*>* From: "4095"<sip:4095 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users>;tag=121754238352072516*>* Max-Forwards: 69*>* To: <sip:4440 at 192.168.0.197 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users>*>* User-Agent: SJphone/1.60.299a/L (SJ Labs)*>* P-App-Name: voicemail*>* P-App-Param: mod=box;usr= voicemail4440;dom=sipproxy.a.com*>* ;uid=voicemail4440;did=sipproxy.a.com;*>* Message Body*>**>* Here you can see the failure_route in my kamailio.cfg file:*>**>* # Sample failure route*>* failure_route[FAIL_ONE] {*>* #ifdef WITH_NAT*>* if (is_method("INVITE")*>* && (isbflagset("6") || isflagset(5))) {*>* unforce_rtp_proxy();*>* }*>* #endif*>**>* if (t_is_canceled()) {*>* exit;*>* }*>**>* # uncomment the following lines if you want to block client*>* # redirect based on 3xx replies.*>* ##if (t_check_status("3[0-9][0-9]")*>* ) {*>* ##t_reply("404","Not found");*>* ## exit;*>* ##}*>**>* # uncomment the following lines if you want to redirect the failed*>* # calls to a different new destination*>* if (t_check_status("486|408")) {*>* revert_uri();*>* prefix("voicemail");*>* remove_hf("P-App-Name");*>* append_hf("P-App-Name: voicemail\r\n");*>* append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com*>* ;uid=$rU;did=sipproxy.a.com;\r\n");*>* $ru = "sip:" + $rU + "@" + "192.168.0.197:5080";*>* #rewritehostport("192.168.0.197:5080");*>* #append_branch("sip:4888 at 192.168.0.102 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users");*>* append_branch();*>* # do not set the missed call flag again*>* t_relay();*>* }*>* }*>**>* Has anybody experienced this problem? Any help would be wellcome*>**>* Best Regards*>**>* LAA*>
On Wednesday 24 July 2013 20:41:04 LAA wrote:
May be I'm loosing something. I have changed my config as you suggested (I thing so...):
if (t_check_status("486|408")) {
...
$du = $null; #$du = "sip:192.168.0.197"; append_branch(); t_relay();
Did you try without the append_branch()?
Hello Daniel,
I have tried without append_branch(); and it just don't create the new branch and it sends back the 486 message to the UAC that originated the call:
if (t_check_status("486|408")) {
revert_uri(); prefix("voicemail"); remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com ;uid=$rU;did=sipproxy.a.com;\r\n"); rewritehostport("192.168.0.197:5080"); $du = $null; #$du = "sip:192.168.0.197"; #append_branch(); t_relay();
} }
|Time | 192.168.3.20 | 192.168.0.167 | | | | 192.168.0.197 | |3,415 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,420 | 407 Proxy Authentication Required | |SIP Status | |(5060) <------------------ (5060) | | |3,422 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,422 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,435 | 100 trying -- your call is important to us | |SIP Status | |(5060) <------------------ (5060) | | |3,436 | | INVITE SDP ( telephone-event) |SIP Request | | |(5060) ------------------> (5060) | |3,437 | | 100 Trying| |SIP Status | | |(5060) <------------------ (5060) | |3,437 | | 486 Busy Here |SIP Status | | |(5060) <------------------ (5060) | |3,441 | | ACK | |SIP Request | | |(5060) ------------------> (5060) | |3,459 | 486 Busy Here | |SIP Status | |(5060) <------------------ (5060) | | |3,461 | ACK | | |SIP Request | |(5060) ------------------> (5060) | |
Regards
Luis
2013/7/25 Daniel Tryba daniel@pocos.nl
On Wednesday 24 July 2013 20:41:04 LAA wrote:
May be I'm loosing something. I have changed my config as you suggested (I thing so...):
if (t_check_status("486|408")) {
...
$du = $null; #$du = "sip:192.168.0.197"; append_branch(); t_relay();
Did you try without the append_branch()?
--
POCOS B.V. - Croy 9c - 5653 LC Eindhoven Telefoon: 040 293 8661 - Fax: 040 293 8658 http://www.pocos.nl/ - http://www.sipo.nl/ K.v.K. Eindhoven 17097024
On Thursday 25 July 2013 16:30:21 you wrote:
if (t_check_status("486|408")) {
revert_uri(); prefix("voicemail"); remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com
;uid=$rU;did=sipproxy.a.com;\r\n"); rewritehostport("192.168.0.197:5080"); $du = $null; #$du = "sip:192.168.0.197"; #append_branch(); t_relay();
Taking a look at my config which I found to work after the long struggle you are experiencing right now.
if($avp(dst_voicemail)) { $du=$null; $ru = "sip:tovm-" + $avp(dst_voicemail) + "@" + $sel(cfg_get.voicemail.srv_ip) + ":" + $sel(cfg_get.voicemail.srv_port); route(RELAY);
exit; }
Which effectively sets $du to null (if not null the message would get relayed to the original destination (the proxy itself)) and rewrites $ru to something like "sip:tovm-0123456789@voicemail:5060" and then just do the normal relay route to deliver the message. Your *_hf shouldn't have any effect on routing.
OK, Daniel and thanks for your help,
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:
if (t_check_status("486|408")) {
#revert_uri(); prefix("voicemail"); remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com ;uid=$rU;did=sipproxy.a.com;\r\n"); rewritehostport("192.168.0.197:5080"); $du = $null; #append_branch(); route(RELAY); #t_relay();
} }
And kamailio gets into a strange behavior
|Time | 192.168.3.20 | 192.168.0.167 | | | | 192.168.0.197 | |3,366 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,370 | 407 Proxy Authentication Required | |SIP Status | |(5060) <------------------ (5060) | | |3,380 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,382 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,393 | 100 trying -- your call is important to us | |SIP Status | |(5060) <------------------ (5060) | | |3,394 | | INVITE SDP ( telephone-event) |SIP Request | | |(5060) ------------------> (5060) | |3,395 | | 100 Trying| |SIP Status | | |(5060) <------------------ (5060) | |3,395 | | 486 Busy Here |SIP Status | | |(5060) <------------------ (5060) | |3,398 | | ACK | |SIP Request | | |(5060) ------------------> (5060) | |3,416 | 500 I'm terribly sorry, server error occurred ...SL) | |SIP Status | |(5060) <------------------ (5060) | | |3,416 | 486 Busy Here | |SIP Status | |(5060) <------------------ (5060) | | |3,418 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,418 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,872 | 486 Busy Here | |SIP Status | |(5060) <------------------ (5060) | | |3,873 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |4,875 | 486 Busy Here | |SIP Status | |(5060) <------------------ (5060) | | |4,876 | ACK | | |SIP Request | |(5060) ------------------> (5060) | |
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:
if ($rU=~"^voicemail.*") { remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr=$rU;dom=sipproxy.a.com ;uid=$rU;did=sipproxy.a.com;\r\n"); $ru = "sip:" + $rU + "@" + "192.168.0.197:5080"; route(RELAY); exit; }
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?
Regards.
L.
2013/7/25 Daniel Tryba daniel@pocos.nl
On Thursday 25 July 2013 16:30:21 you wrote:
if (t_check_status("486|408")) {
revert_uri(); prefix("voicemail"); remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com
;uid=$rU;did=sipproxy.a.com;\r\n"); rewritehostport("192.168.0.197:5080"); $du = $null; #$du = "sip:192.168.0.197"; #append_branch(); t_relay();
Taking a look at my config which I found to work after the long struggle you are experiencing right now.
if($avp(dst_voicemail)) { $du=$null; $ru = "sip:tovm-" + $avp(dst_voicemail) + "@" + $sel(cfg_get.voicemail.srv_ip) + ":" + $sel(cfg_get.voicemail.srv_port); route(RELAY);
exit; }
Which effectively sets $du to null (if not null the message would get relayed to the original destination (the proxy itself)) and rewrites $ru to something like "sip:tovm-0123456789@voicemail:5060" and then just do the normal relay route to deliver the message. Your *_hf shouldn't have any effect on routing.
--
POCOS B.V. - Croy 9c - 5653 LC Eindhoven Telefoon: 040 293 8661 - Fax: 040 293 8658 http://www.pocos.nl/ - http://www.sipo.nl/ K.v.K. Eindhoven 17097024
I have checked that I'm , experiencing the same problem when the redirection to voicemail is originated by the destination UAC via 302 message. Kamailio sends the packet to the destination UAC, even when I set $du to null. ??¿?¿?¿¿??¿
if ($rU=~"^voicemail.*") {
$du = $null; remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr=$rU;dom=sipproxy.a.com ;uid=$rU;did=sipproxy.a.com;\r\n"); $ru = "sip:" + $rU + "@" + "192.168.0.197:5080"; $du = $null; route(RELAY); exit; }
Conv.| Time | 192.168.3.20 | 192.168.0.167 | | | | 192.168.0.197 | 0 |3,574 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | 0 |3,575 | 407 Proxy Authentication Required | |SIP Status | |(5060) <------------------ (5060) | | 0 |3,577 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | 0 |3,577 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | 0 |3,584 | 100 trying -- your call is important to us | |SIP Status | |(5060) <------------------ (5060) | | 0 |3,585 | | INVITE SDP ( telephone-event) |SIP Request | | |(5060) ------------------> (5060) | 0 |3,587 | | 100 Trying| |SIP Status | | |(5060) <------------------ (5060) | 0 |3,587 | | 302 Moved Temporarily |SIP Status | | |(5060) <------------------ (5060) | 0 |3,588 | | ACK | |SIP Request | | |(5060) ------------------> (5060) | 0 |3,592 | 302 Moved Temporarily | |SIP Status | |(5060) <------------------ (5060) | | 0 |3,594 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | ----------------------------------------------------------------------------- 1 |3,596 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:voicemail4440@192.168.0.167:5060 | |(5060) ------------------> (5060) | | 1 |3,596 | 407 Proxy Authentication Required | |SIP Status | |(5060) <------------------ (5060) | | 1 |3,600 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | 1 |3,601 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:voicemail4440@192.168.0.167:5060 | |(5060) ------------------> (5060) | | 1 |3,608 | 100 trying -- your call is important to us | |SIP Status | |(5060) <------------------ (5060) | | 1 |3,608 | | INVITE SDP ( telephone-event) |SIP Request | | |(5060) ------------------> (5060) | 1 |3,608 | | 404 Not Found |SIP Status | | |(5060) <------------------ (5060) | 1 |3,609 | | ACK | |SIP Request | | |(5060) ------------------> (5060) | 1 |3,614 | 404 Not Found | |SIP Status | |(5060) <------------------ (5060) | | 1 |3,615 | ACK | | |SIP Request | |(5060) ------------------> (5060) | |
2013/7/25 LAA ornitorrinco7424@gmail.com
OK, Daniel and thanks for your help,
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:
if (t_check_status("486|408")) {
#revert_uri(); prefix("voicemail"); remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com
;uid=$rU;did=sipproxy.a.com;\r\n"); rewritehostport("192.168.0.197:5080"); $du = $null; #append_branch(); route(RELAY); #t_relay();
}
}
And kamailio gets into a strange behavior
|Time | 192.168.3.20 | 192.168.0.167 | | | | 192.168.0.197 | |3,366 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,370 | 407 Proxy Authentication Required | |SIP Status | |(5060) <------------------ (5060) | |
|3,380 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,382 | INVITE SDP ( telephone-event) | |SIP From: sip:4095@192.168.0.197 To:sip:4440@192.168.0.197 | |(5060) ------------------> (5060) | | |3,393 | 100 trying -- your call is important to us | |SIP Status | |(5060) <------------------ (5060) | | |3,394 | | INVITE SDP ( telephone-event) |SIP Request | | |(5060) ------------------> (5060) | |3,395 | | 100 Trying| |SIP Status | | |(5060) <------------------ (5060) | |3,395 | | 486 Busy Here |SIP Status | | |(5060) <------------------ (5060) | |3,398 | | ACK | |SIP Request | | |(5060) ------------------> (5060) | |3,416 | 500 I'm terribly sorry, server error occurred ...SL) | |SIP Status | |(5060) <------------------ (5060) | | |3,416 | 486 Busy Here | |SIP Status | |(5060) <------------------ (5060) | | |3,418 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,418 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |3,872 | 486 Busy Here | |SIP Status | |(5060) <------------------ (5060) | | |3,873 | ACK | | |SIP Request | |(5060) ------------------> (5060) | | |4,875 | 486 Busy Here | |SIP Status | |(5060) <------------------ (5060) | | |4,876 | ACK | | |SIP Request | |(5060) ------------------> (5060) | |
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:
if ($rU=~"^voicemail.*") {
remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr=$rU;dom=sipproxy.a.com
;uid=$rU;did=sipproxy.a.com;\r\n"); $ru = "sip:" + $rU + "@" + "192.168.0.197:5080"; route(RELAY); exit; }
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?
Regards.
L.
2013/7/25 Daniel Tryba daniel@pocos.nl
On Thursday 25 July 2013 16:30:21 you wrote:
if (t_check_status("486|408")) {
revert_uri(); prefix("voicemail"); remove_hf("P-App-Name"); append_hf("P-App-Name: voicemail\r\n"); append_hf("P-App-Param: mod=box;usr= $rU;dom=sipproxy.a.com
;uid=$rU;did=sipproxy.a.com;\r\n"); rewritehostport("192.168.0.197:5080"); $du = $null; #$du = "sip:192.168.0.197"; #append_branch(); t_relay();
Taking a look at my config which I found to work after the long struggle you are experiencing right now.
if($avp(dst_voicemail)) { $du=$null; $ru = "sip:tovm-" + $avp(dst_voicemail) + "@" + $sel(cfg_get.voicemail.srv_ip) + ":" + $sel(cfg_get.voicemail.srv_port); route(RELAY);
exit; }
Which effectively sets $du to null (if not null the message would get relayed to the original destination (the proxy itself)) and rewrites $ru to something like "sip:tovm-0123456789@voicemail:5060" and then just do the normal relay route to deliver the message. Your *_hf shouldn't have any effect on routing.
--
POCOS B.V. - Croy 9c - 5653 LC Eindhoven Telefoon: 040 293 8661 - Fax: 040 293 8658 http://www.pocos.nl/ - http://www.sipo.nl/ K.v.K. Eindhoven 17097024