#31 Dynamic Response Codes

open
nobody
5
2012-12-15
2011-09-14
MManickam
No

Hi: I am a great fan of SIPP. I often use this to test the end-to-end interoperability.

I have a situation, where I needed to test a black box that has a causecode map defined.

In order to test the box, I needed to release the invites with various cause codes.

I found that variable replacement could be a great method to do.. But currently sipp does not allow variable placement to send responses [it is understandable due to the ladder].

When a test call is placed to NPANXXZABC, I can grep "ABC" and use that as my response code. In this way, I can manually place call and feel the response of the system for each response code.

For e.g. when I dial 9105880400 --> when it reaches SIPP I should be able to program such a way that I will send response 400.

<recv request="INVITE">
<action>
<ereg regexp="Content-Type:.*" search_in="msg" assign_to="1"/>
<log message="SDP in INVITE [$1]"/>
<ereg regexp="INVITE sip:(\+[[:alnum:]]*)@*" search_in="msg" check_it=i"true" assign_to="p1,p2"/>
<log message="After Search in INVITE -- [$p1] -- [$p2]"/>
</action>
</recv>

<send>
<![CDATA[
SIP/2.0 100 Trying
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Content-Length:0
]]>
</send>

<nop>
<action>
<lookup assign_to="line" file="err.map" key="[$p2]"/>
<assignstr assign_to="errcode" value="[field1 line=\"[$line]\"]" />
<assignstr assign_to="errtext" value="[field2 line=\"[$line]\"]" />
<log message="Found [$errcode] [$errtext] in phone.map for [$p1] [$p2]"/>
</action>
</nop>

<send>
<![CDATA[

SIP/2.0 [$errcode] [$errtext]
[last_From:]
[last_To:];tag=[call_number]
[last_Via:]
[last_CSeq:]
[last_Call-ID:]
Content-Length:0

]]>
</send>

<recv request="ACK">
</recv>

</scenario>

USERS,PRINTF=999
#Incoming Phone;Errorcode;errormsg
+19109694%03d;%03d;Error Code %03d

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks