16 nov 2012 kl. 12:18 skrev Kamal Palei <palei.kamal(a)gmail.com>om>:
Dear All
When I get INVITE (received in UDP), I send it to another proxy in TLS.
For this purpose I have modified kamailio.cfg route section , please refer the lines in
red.
Just before sending in TLS, I modify the IP address in SDP, so that media packets will
pass through RTP proxy running
When INVITE is reached the next proxy, I see the IP address is changed . So far so good.
Next I am trying to modify the IP address in 200 OK to INVITE.
However it is not taking effect.
I hope we need to modify in onreply_route function. Something is wrong here. I am
receiving 200 OK for INVITE in TLS. Next I am sending 200 OK for INVITE to endpoints using
UDP. Not sure if onreply_route is being executed or not. Can somebody give me pointer
whats wrong here.
THe onreply_route {} is executed for every response. If you want to trigger your
own reply route, like your onreply_route[REPLY_ONE] {} you have to do it with the TM
module funcition
t_on_reply().
/O
# Sample onreply route
onreply_route[REPLY_ONE] {
xdbg("incoming reply\n");
#!ifdef WITH_NAT
if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB))
&& status=~"(183)|(2[0-9][0-9])") {
force_rtp_proxy("r");
}
if (isbflagset(FLB_NATB)) {
fix_nated_contact();
}
#!endif
}
# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
route {
# per request initial checks
route(REQINIT);
setflag(FLT_NATS);
# NAT detection
route(NAT);
if(is_method("PUBLISH"))
{
loose_route();
t_relay();
exit;
}
if(is_method("REGISTER"))
{
t_relay_to("tls:115.114.48.75:443");
exit();
}
if(is_method("INVITE|BYE|CANCEL|SUBSCRIBE|REFER|NOTIFY"))
{
xdbg("incoming request\n");
route(RTPPROXY);
t_relay_to("tls:115.114.48.75:443");
exit();
}
--
* Olle E. Johansson - oej(a)edvina.net
* Kamailio & SIP Masterclass Miami FL December 2012
*
http://edvina.net/training/