[OpenSER-Users] redirect server and handling 302 messages

erik.linder at accenture.com erik.linder at accenture.com
Wed Sep 12 18:59:31 CEST 2007


I had a look, and since I have 2 Via, that is the reason why it is transferring the 302 to 192.168.200.10. 

So how can I block the forward of the message to the second Via. But this ignore Via on the proxy has to be in the INVITE that is redirected. Would that be possible?


Example of received 302

05:25:42.179996 IP 192.168.200.101.sip > 192.168.200.102.sip: SIP, length: 488
E..... at .@......e...f.......sSIP/2.0 302 Moved temporarily
Via: SIP/2.0/UDP 192.168.200.102;branch=z9hG4bK53b7.a44d16b1.0
Via: SIP/2.0/UDP 192.168.200.10:5060;branch=z9hG4bK2gkd7l3080l0db8cu101.1
To: "22222"<sip:22222 at btsip.bt.com>;tag=cc0e227ef05fff2dd833db745f3905a6.f119
From: "111"<sip:11111 at btsip.bt.com>;tag=SD1fde301-7a257c4b
Call-ID: SD1fde301-6adec9cad3c8a47f2637827ddb83df97-06ahc50
CSeq: 1 INVITE
Contact: , sip:22222 at 192.168.200.103:5060;maddr=192.168.200.103:5060;side=term>
Content-Length: 0

-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro] 
Sent: vendredi 7 septembre 2007 19:07
To: Linder, Erik
Cc: 
Subject: Re: [OpenSER-Users] redirect server and handling 302 messages

Hi Erik,

yes, it is known limitation that the proxy does not look for the maddr 
param.....

regarding the second question, do you want to block the 30x redirects 
targeting the SBC? see that the uac_redirect allows you to set some 
filters for the contacts...

regards,
bogdan

erik.linder at accenture.com wrote:
>
> Hello,
>
> I'm trying to make openser process 302 messages though I have 
> problems(part of .cfg file below). I'll briefly explain the call flow 
> I'd like to have:
>
> UA1 ---INVITE---> Session border controller ---INVITE--->SIP PROXY1
>
> SIP PROXY1---INVITE--->REDIRECT SERVER---302 MOVED--->SIP PROXY1
>
> SIP PROXY1---INVITE--->SIP PROXY2---INVITE---> Session border 
> controller---INVITE-à UA2
>
> This is how I want it to work. However managed to get a weird call 
> flow were the 302 is forwarded back to the session border controller 
> by the proxy1 which then trigger an INVITE sent to the SIP proxy2. But 
> that is not what I want.
>
> My 302 message looks like this
>
> 20:12:34.314705 IP 192.168.200.101.sip > 192.168.200.102.sip: SIP, 
> length: 488
>
> E..... at .@.%....e...f........SIP/2.0 302 Moved temporarily
>
> Via: SIP/2.0/UDP 192.168.200.102;branch=z9hG4bK1658.2543f3d6.0
>
> Via: SIP/2.0/UDP 192.168.200.10:5060;branch=z9hG4bKpis9m130dgj04b08v7k1.1
>
> To: 
> "22222"<sip:22222 at btsip.bt.com>;tag=cc0e227ef05fff2dd833db745f3905a6.25f2
>
> From: "111"<sip:11111 at btsip.bt.com>;tag=SDvto0501-df614a6e
>
> Call-ID: SDvto0501-515b91532ff7927a8345f39add52762f-06ahc50
>
> CSeq: 1 INVITE
>
> Contact: , sip:22222 at mydomain.com;maddr=192.168.200.103:5060;side=term>
>
> Content-Length: 0
>
> 192.168.200.101 is redirect server
>
> 192.168.200.102 is the proxy1
>
> 192.168.200.103 is proxy2
>
> 192.168.200.10 is session border controller
>
>    1. I would like to have proxy1 process the 302 message but there
>       seems (from other mails on the mailing list) that openser does
>       not allow routing depending on maddr in the Contact field. Sic L
>       <- how can this routing decision been taken , using
>       rewritehostport after get_redirect("*") is kind of ignored. The
>       only workaround I have is to change the mydomain.com to the IP
>       of proxy2 to get the automatic redirect
>    2. How can I block the redirect to the session border controller
>       and send an invite right away to the proxy2?
>
> Here are the relevant part of the logic I use in proxy1 to handle the 302
>
> I'm using this to trigger the forward to the redirect server:
>
> lookup("aliases");
>
> #dest is remote
>
> if (!lookup("location")) {
>
> t_on_failure("3");
>
> xlog("L_INFO","redirect invite to SLS\n");
>
> #change orig to term in request URI
>
> $avp(s:request_uri_to_use)=$ru;
>
> avp_subst("$avp(s:request_uri_to_use)", "/orig/term/");
>
> avp_pushto("$ru","$avp(s:request_uri_to_use)");
>
> #forward("udp:192.168.200.101:5060");
>
> #exit;
>
> rewritehostport("192.168.200.101:5060");
>
> if(!t_relay())
>
> {
>
> sl_reply_error();
>
> }
>
> return;
>
> and this to try to handle the 302 that is received but it does not 
> behave like I want:
>
> failure_route[3]
>
> {
>
> xlog("L_WARN","redirect FAILUREROUTE: time_t=$Ts messageid=$mi 
> remark=here we are $bR\n");
>
> if(t_check_status("3[0-9][0-9]"))
>
> {
>
> get_redirects("*");
>
> xlog("L_WARN","^method=$rm ^ruri=$ru ^messageid=$mi^remark=2status is 
> 3xx\n--$br--\nbR((($bR)))\n");
>
> #rewritehost("$(ru{uri.maddr})");
>
> serialize_branches(0);
>
> }
>
> xlog("L_WARN","nextbranch\n");
>
> #next_branches();
>
> #t_on_failure("3");
>
> #t_relay();
>
> return;
>
> #t_reply("404", "No branches left");
>
> }
>
> Help would be appreciated
>
> Cheers
>
> erik
>
> This message is for the designated recipient only and may contain 
> privileged, proprietary, or otherwise private information. If you have 
> received it in error, please notify the sender immediately and delete 
> the original. Any other use of the email by you is prohibited.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>   



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.




More information about the Users mailing list