Reacting to 302 response

53 views
Skip to first unread message

Paul Miller

unread,
Mar 2, 2015, 6:15:43 AM3/2/15
to sip-in...@googlegroups.com
Hi,
I am having trouble getting SIP Inspector to see a 302 response to an INVITE as expected, it is always seen as unexpected and therefore my script below stops.

perhaps someone can pointout why the script is failing?

Thanks

Paul

////////////////////////////////////////////////////////////////////////////////
// REGISTER scenario using redirect server
// 
//  SIP Messages
//  ============
//
//  ---> REGISTER
//  <--- 302
//  ---- Set Remote
//  ---> REGISTER
//  <--- 401
//  ---> REGISTER
//  <--- 200
//
//  End:
//
// values field mapping
// [field0] - SIP Domain 
// 
////////////////////////////////////////////////////////////////////////////////


---------->
REGISTER sip:[field0] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[authUsername]@[field0]>;tag=24de4a5dbe4ef
To: <sip:[authUsername]@[field0]>
Call-ID: [call_number]@[local_ip]
CSeq: [cseq] REGISTER
Max-Forwards: 70
Contact: <sip:[authUsername]@[local_ip]:[local_port];transport=[transport]>
Content-Length: 0


<----------
302 Moved Temporarily


----------
set_Variable=REDURI "Contact:" "sip;*;"


----------
set_Variable=REDport "Contact:" ";*;maddr"


----------
set_Variable=REDmadddr "Contact:" ";maddr=*"


----------
cmd_setRemote=[$REDmadddr]



---------->
REGISTER sip:[REDURI] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[authUsername]@[field0]>;tag=24de4a5dbe4ef
To: <sip:[authUsername]@[field0]>
Call-ID: [call_number]@[local_ip]
CSeq: [cseq] REGISTER
Max-Forwards: 70
Contact: <sip:[authUsername]@[local_ip]:[local_port];transport=[transport]>
Content-Length: 0


<----------
401 Unauthorized


---------->
REGISTER sip:[field0] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[authUsername]@[field0]>;tag=24de4a5dbe4ef
To: <sip:[authUsername]@[field0]>
Call-ID: [call_number]@[local_ip]
CSeq: [cseq+1] REGISTER
Max-Forwards: 70
Contact: <sip:[authUsername]@[local_ip]:[local_port];transport=[transport]>
Authorization: [authentication username=[authUsername]; password=[authPassword];]
Content-Length: 0


<----------
200 OK


----------
label=End

Zarko C

unread,
Mar 2, 2015, 6:25:17 AM3/2/15
to sip-in...@googlegroups.com

The script only deals with REGISTER requests. Please explain what are you trying to achieve. Include Wireshark trace too.

Z

--
To post to this group, send email to sip-in...@googlegroups.com
To unsubscribe from this group, send email to
sip-inspecto...@googlegroups.com
http://groups.google.com/group/sip-inspector?hl=en?hl=en

idkpmiller

unread,
Jun 4, 2015, 5:26:38 PM6/4/15
to sip-in...@googlegroups.com
Hi,
I am trying to test the redirect server in our network (Broadworks Network Server), hence the only response I will get from the redirect server is a 302 with the contact fields holding the next hops to use for the registrar.
I will send your the pcap privately

For others looking to use this as information the call flow is this

UAC                  Redirect Svr                   Registrar
=====================================

Register ------------------>
<-------------------------302
Register --------------------------------------------------->
<----------------------------------------------------------401
Register --------------------------------------------------->
<----------------------------------------------------------200


Thanks

Paul

Zarko C

unread,
Jun 4, 2015, 5:29:01 PM6/4/15
to sip-in...@googlegroups.com

Hey Paul, can you clarify what is the issue with this scenario?

Z

Paul Miller

unread,
Jun 4, 2015, 6:11:15 PM6/4/15
to sip-in...@googlegroups.com
I am having trouble getting SIP Inspector to see a 302 response to an REGISTER as 'expected', it is always seen as 'unexpected' and therefore my script stops.

Thanks

Paul


On Fri, Jun 5, 2015 at 9:29 AM, Zarko C <sipinsp...@gmail.com> wrote:

Hey Paul, can you clarify what is the issue with this scenario?

Z

--

SIP Inspector

unread,
Jun 4, 2015, 8:12:25 PM6/4/15
to sip-in...@googlegroups.com, idkpm...@sip2serve.com
Hey Paul!

You did sent a WS trace, where I see all messages exchanged as expected. I guess this is between some other client and the server and when everything works OK. I need to get a WS trace of the traffic that happens between the server and SIP Inspector. Also, attach scenario file that you use. If you want to protect privacy please send it to my email address directly. Files have to be attached.

One mistake I noticed in your scenario file is that you do not use [$REDURI]. All user defined variables have to be used with '$' sign.

Z

idkpmiller

unread,
Jun 5, 2015, 4:46:08 PM6/5/15
to sip-in...@googlegroups.com, idkpm...@sip2serve.com
Hi Zarko,
I did some checking of the lab environment and the issue and realised that it not specifically related to the 302 use case, it seems to be more fundamental than a particular SIP transaction, I will attach the files that show the same issue occurring with a simple OPTIONS ping and a 200 response being classified as unexpected.
I am wondering if the UDP src port change for the response message is causing SIP inspector to not acknowledge the message is expected?

Thanks

Paul
screenshot.jpeg
sip-filtered.pcap.pcapng
UAC-OPTIONS_Device.txt

Zarko C

unread,
Jun 5, 2015, 4:56:04 PM6/5/15
to sip-in...@googlegroups.com
I got the files and will look into what the issue may be. I believe the problem is because of conditional statements (---- if....) These statements exist in the scenario file but not on the progress screen. Try removing them from the scenario file and see if 200 OK is received. I will investigate what is wrong with conditional statements.

Zarko

SIP Inspector

unread,
Jun 5, 2015, 5:06:03 PM6/5/15
to sip-in...@googlegroups.com, sipinsp...@gmail.com, idkpm...@sip2serve.com
It turns out you had invalid scenario file. Attached is a correct and working copy.

Zarko
UAC-OPTIONS_Device.txt

Zarko Coklin

unread,
Jun 7, 2015, 5:23:10 PM6/7/15
to sip-in...@googlegroups.com, idkpm...@sip2serve.com
I just released a new version 3.45 which you can download from here. It corrected conditional branching logic. I tested the new code against the attached scenario file. You should be able to continue working with conditional branching scenarios now.

Zarko
UAC-OPTIONS_Device.txt
Reply all
Reply to author
Forward
0 new messages