[SR-Users] Trying to drop invite 200ok reply in onreply_route
nikita
nikita at mbdsys.com
Fri Nov 26 12:55:59 CET 2010
Hello,
I'm using kamailio 3.0 with mediaproxy and I want to cancel calls if I have no mediaproxy relay connected to my mediaproxy dispatcher.
In my request route I'm checking if "use_media_proxy()" is returning me a positive result and it's working fine :
use_media_proxy();
if($rc < 0) {
sl_send_reply("480","Temporarily Unavailable");
exit;
}
But I'm also want check in my onreply_route If I still have an active relay because I need to rewrite the sdp in the 200/OK reply.
My problem is that I don't know how to end the transaction, I have tried :
if (is_method("INVITE") && status == "200") {
#!ifdef WITH_MEDIA_PROXY
use_media_proxy();
if($rc < 0) {
xlog("L_ERR", "invite reply error $rc \n");
dlg_bye("all");
}
#!endif
}
and also :
if (is_method("INVITE") && status == "200") {
#!ifdef WITH_MEDIA_PROXY
use_media_proxy();
if($rc < 0) {
xlog("L_ERR", "invite reply error $rc \n");
drop();
}
#!endif
}
In both case I'm seeing in my log file that use_media_proxy() returned me -1, but the reply is routed to the caller ...
Any idea on how I can cancel my call in the onreply_route ?
Also, I don't know if it's a good thing to make a second call to "use_media_proxy" in the onreply_route, mediaproxy module couldn't reply me with a different relay address if I have multiple mediaproxy relay?
Regards,
--
Nikita
More information about the sr-users
mailing list