|
From: Moritz G. <mor...@g-...> - 2014-01-20 11:34:04
|
Hi Folks,
i want to check the following scenario:
SIPP kamailio redirect server
# #
------------------------------->
INVITE
<-------------------------------
302 Moved temporartely
So I am sending an INVITE to a kamailio. In the 302 answer the server
submits a redirect destination in the CONTACT-Header. I want to verify
if there is a correct value.
The Check works in 199 from 200 cases. But in this one case the check
fails... and I can't find the reason.
I am calling sipp as follows:
######################################################################
/usr/bin/sipp -trace_err -m 1 -r 5 -timeout 1s -send_timeout 1s
-recv_timeout 1s -f 10 -p 5065 -i 1.2.3.4 -sf
/usr/lib/nagios/plugins/check_redirect_stateless.sipp -inf
/var/lib/nagios/check_redirect_stateless.user 1.2.3.4:5070
######################################################################
The userfile looks like this:
######################################################################
SEQUENTIAL
# $Id: ----
# This is the INPUT-File for check_simple_redirect
# SIPp-Testscript
#server,user,expectedResult
1.2.3.4;B900100491234567;B191000491234567
1.2.3.4;B900200491234567;B291000491234567
######################################################################
First Column: kamailio Server IP
Second Column: The String to be sent in the INVITE in the TO: HEader
Third Column: The String I expect in the Contact: Header
And finaly the sipp check:
######################################################################
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $Id: -----
This is the SIPp XML-File for a simple Redirect Check
-->
<scenario name="Test LCR">
<send>
<![CDATA[
INVITE sip:[field1]@[field0]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: sipp <sip:[field1]@[field0]:[local_port]>;tag=[pid]
To: sut <sip:[field1]@[field0]>
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: <sip:[field1]@[local_ip]:[local_port];transport=udp>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[local_ip_type] [local_ip]
t=0 0
m=audio [auto_media_port] RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11,16
]]>
</send>
<!-- waitr for 302 -->
<recv response="302" optional="false" next="OK" test="test_OK"
timeout="1">
<action>
<!-- regex, contactpart to 'test' -->
<ereg regexp="<sip:([0-9A-Z]+)@.*" search_in="hdr" header="Contact:"
case_indep="true" check_it="true" assign_to="null,test"/>
<!-- field2 to fieldstring save for strcmp -->
<assignstr assign_to="fieldstring" value="[field2]" />
<!-- check if contact has correct string and save to result -->
<strcmp assign_to="result" variable="test" variable2="fieldstring"
check_it="true"/>
<log message="result=[$result] test=[$test]
fieldstring=[$fieldstring]" />
<!-- check if strings are equal -->
<test assign_to="test_OK" variable="result" compare="equal"
value="0.0" />
</action>
</recv>
<!-- recv is only reached if the above check failed-->
<recv response="599" timeout="1"></recv>
<label id="OK" />
<Reference variables="test"/>
<Reference variables="result"/>
<Reference variables="null" />
<Reference variables="test_OK" />
</scenario>
######################################################################
The ERROR logged by sipp is as follows:
######################################################################
sipp: The following events occured:
2014-01-20 11:17:57:194 1390213077.194807: Call-Id: 1-20926@1.2.3.4,
receive timeout on message Test LCR:1 without label to jump to
(ontimeout attribute): aborting call.
2014-01-20 11:17:57:195 1390213077.195609: Dead call 1-20926@1.2.3.4
(aborted at index 1), received 'SIP/2.0 302 Temporarely Moved
Via: SIP/2.0/UDP 1.2.3.4:5065;branch=z9hG4bK-20926-1-0
From: sipp <sip:B900100491234567@1.2.3.4:5065>;tag=20926
To: sut
<sip:B900100491234567@1.2.3.4>;tag=56398122a1ea83737b581412f70829d1.df04
Call-ID: 1-20926@1.2.3.4
CSeq: 1 INVITE
Contact: <sip:B191000491234567@1.2.3.4:5070>
Server: kamailio (4.0.3 (i386/linux))
Content-Length: 0
'.
######################################################################
Any help appricaiated!!
greetz
|