List Info

Thread: redirect server and handling 302 messages




redirect server and handling 302 messages
user name
2007-09-07 09:16:11

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.......%....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:22222btsip.bt.com>;tag=cc0e227ef05fff2dd833db745f3905a6.25f2

From: &quot;111";<sip:11111btsip.bt.com>;tag=SDvto0501-df614a6e

Call-ID: SDvto0501-515b91532ff7927a8345f39add52762f-06ahc50

CSeq: 1 INVITE

Contact: , sip:22222mydomain.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:

 

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; lookup("aliases");

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  #dest is remote

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  if (!lookup(&quot;location")) {

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; t_on_failure(&quot;3");

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;   xlog("L_INFO",&quot;redirect invite to SLSn");

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; #change orig to term in request URI

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; $avp(s:request_uri_to_use)=$ru;

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; avp_subst("$avp(s:request_uri_to_use)", "/orig/term/&quot;);

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; avp_pushto(";$ru","$avp(s:request_uri_to_use)&quot;);

 

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; #forward("udp:192.168.200.101:5060");

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; #exit;

 &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;rewritehostport(&quot;192.168.200.101:5060");

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; if(!t_relay())

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; {

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  sl_reply_error();

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  }

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; return;

 

and this to try to handle the 302 that is received but it does not behave like I want:

 

failure_route[3]

{

 &nbsp; &nbsp; &nbsp;  xlog(";L_WARN&quot;,"redirect FAILUREROUTE: time_t=$Ts messageid=$mi remark=here we are $bRn");

 &nbsp; &nbsp; &nbsp;  if(t_check_status(&quot;3[0-9][0-9]"))

 &nbsp; &nbsp;   &nbsp;{

 &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; get_redirects("*&quot;);

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; xlog(&quot;L_WARN",&quot;^method=$rm ^ruri=$ru ^messageid=$mi^remark=2status is 3xxn--$br--nbR((($bR)))n");

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; #rewritehost(&quot;$(ru{uri.maddr})&quot;);

 &nbsp; &nbsp; &nbsp;  serialize_branches(0);

 &nbsp; &nbsp; &nbsp;  }

 &nbsp; &nbsp;  &nbsp; xlog("L_WARN",&quot;nextbranchn");

 &nbsp; &nbsp; &nbsp;  #next_branches();

 &nbsp; &nbsp; &nbsp;  #t_on_failure("3");

 &nbsp; &nbsp; &nbsp;  #t_relay();

 &nbsp; &nbsp; &nbsp;  return;

 &nbsp; &nbsp; &nbsp;  #t_reply(&quot;404&quot;, "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.

Re: redirect server and handling 302 messages
country flaguser name
Romania
2007-09-07 12:07:05
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.linderaccenture.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.......%....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:22222btsip.bt.com>;tag=cc0e227ef05fff2dd833db745f3905a6
.25f2
>
> From: "111"<sip:11111btsip.bt.com>;tag=SDvto0501-df614a6e
>
> Call-ID:
SDvto0501-515b91532ff7927a8345f39add52762f-06ahc50
>
> CSeq: 1 INVITE
>
> Contact: , sip:22222mydomain.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
SLSn");
>
> #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)&
quot;);
>
> #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 $bRn");
>
> if(t_check_status("3[0-9][0-9]"))
>
> {
>
> get_redirects("*");
>
> xlog("L_WARN","^method=$rm ^ruri=$ru
^messageid=$mi^remark=2status is 
> 3xxn--$br--nbR((($bR)))n");
>
> #rewritehost("$(ru{uri.maddr})");
>
> serialize_branches(0);
>
> }
>
> xlog("L_WARN","nextbranchn");
>
> #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
> Usersopenser.org
> htt
p://openser.org/cgi-bin/mailman/listinfo/users
>   


_______________________________________________
Users mailing list
Usersopenser.org
htt
p://openser.org/cgi-bin/mailman/listinfo/users

RE: redirect server and handling 302 messages
user name
2007-09-12 11:59:31
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............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:22222btsip.bt.com>;tag=cc0e227ef05fff2dd833db745f3905a6
.f119
From: "111"<sip:11111btsip.bt.com>;tag=SD1fde301-7a257c4b
Call-ID: SD1fde301-6adec9cad3c8a47f2637827ddb83df97-06ahc50
CSeq: 1 INVITE
Contact: , sip:22222192.168.200.103:5060;maddr=192.168.200.103:5060;side=
term>
Content-Length: 0

-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdanvoice-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.linderaccenture.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.......%....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:22222btsip.bt.com>;tag=cc0e227ef05fff2dd833db745f3905a6
.25f2
>
> From: "111"<sip:11111btsip.bt.com>;tag=SDvto0501-df614a6e
>
> Call-ID:
SDvto0501-515b91532ff7927a8345f39add52762f-06ahc50
>
> CSeq: 1 INVITE
>
> Contact: , sip:22222mydomain.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
SLSn");
>
> #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)&
quot;);
>
> #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 $bRn");
>
> if(t_check_status("3[0-9][0-9]"))
>
> {
>
> get_redirects("*");
>
> xlog("L_WARN","^method=$rm ^ruri=$ru
^messageid=$mi^remark=2status is 
> 3xxn--$br--nbR((($bR)))n");
>
> #rewritehost("$(ru{uri.maddr})");
>
> serialize_branches(0);
>
> }
>
> xlog("L_WARN","nextbranchn");
>
> #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
> Usersopenser.org
> htt
p://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.

_______________________________________________
Users mailing list
Usersopenser.org
htt
p://openser.org/cgi-bin/mailman/listinfo/users

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )