What the QA folks in my group do is set an environment variable in a script to 
the output of a command, then set a SIPP variable by passing it in with the 
syntax '-key sippvariable1 shellvariable1'. In the scenario, they reference 
[sippvariable1].

Roughly they would have something like:

Shell script:

#!/bin/sh
domain=$(cat domain.txt)
sipp  .... -sf register.xml -key domain $domain ...

XML Scenario:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<scenario name="Example">
<!-- This scenario expects the following variables to be defined:
 domain
--!>
<!-- REGISTER -->
<send retrans="500">
<![CDATA[
REGISTER sip:[domain] SIP/2.0
...
]]>
</send>
...

Hopefully that's useful.

Shane Turner

On 29/09/2014 5:15 AM, Paul Miller wrote:
Thanks Cheng Kun for the idea of using an external command, following on from 
that thought.

if I run the following command in bash I get the RFC 1133 format I require for 
the Date: header

date -d "+12 months" +"%a, %d %b %Y 00:00:01 GMT"

Although the SIPp documentation shows how to echo the contents of a varaible to 
a text file it does not show how to set a new variable equal to the output of a 
external command, can SIPp do such a thing?

Thanks

Paul


On Mon, Sep 29, 2014 at 7:39 PM, 程琨 
<chengku...@gmail.com<mailto:chengku...@gmail.com>> wrote:
I have an script using variables, hope it can give you some hints.

The related part is :

<scenario name="INVITE with Auth UAC">
 <send retrans="500" start_txn="invite">
   <![CDATA[
     INVITE sip:[field3]@[field1]:[remote_port] SIP/2.0
     Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
     From: sipp 
<sip:sipp@[local_ip]:[local_port]><sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
     To: sut 
<sip:[field3]@[field1]:[remote_port]><sip:[field3]@[field1]:[remote_port]>
     Call-ID: [call_id]
     CSeq: [cseq] INVITE
     Contact: 
<sip:sipp@[local_ip]:[local_port]><sip:sipp@[local_ip]:[local_port]>
     Max-Forwards: 70
     Subject: Performance Test
     User-Agent: SIPp Tester
     Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
     Content-Type: application/sdp
     Content-Length: [len]

     v=0
     o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
     s=-
     c=IN IP[media_ip_type] [media_ip]
     t=0 0
     m=audio [media_port] RTP/AVP 0
     a=rtpmap:0 PCMU/8000
   ]]>
 </send>

 <recv response="100" optional="true" rrs="true" response_txn="invite">
 </recv>

 <!-- grab the Contact Header's URI for use in the response ACK -->
 <recv response="401" auth="true" rrs="true" response_txn="invite">
      <action>
               <ereg regexp= "sip:[^;&gt;]+"<sip:[^;&gt;]+>  search_in="hdr" 
header="Contact:" assign_to="2" />
       </action>
 </recv>

 <!-- decrement the branch by 3 to match the above INVITE's branch -->
 <send ack_txn="invite">
   <![CDATA[
     ACK sip:[field3]@[$2] SIP/2.0
     Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch-3]
     From: sipp 
<sip:sipp@[local_ip]:[local_port]><sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
     [last_To]
     [routes]
     Call-ID: [call_id]
     CSeq: [cseq] ACK
     Contact: 
<sip:sipp@[local_ip]:[local_port]><sip:sipp@[local_ip]:[local_port]>
     Max-Forwards: 70
     Subject: Performance Test
     User-Agent: SIPp Tester
     Content-Length: 0
   ]]>
 </send>

In this example it searches in Contact header and assigns value to variable 2, 
then  sends ACK  by judging the 2's value.

But can you modify the date and timestamp?

Cheng Kun

2014-09-29 12:15 GMT+08:00 Paul Miller 
<idkpmil...@sip2serve.com<mailto:idkpmil...@sip2serve.com>>:
Hi,
I am currently using SIPp 3.4.1 and I trying to emulate a UAS which uses the 
Date: and Timestamp: header in its messaging. Is there a way to populate this 
header with an internal variable/keyword that will be populated by SIPp when 
the scenario is run?
If not can you consider adding support for date and timestamp header?

Example header format below:

Date: Mon, 22 Sep 2014 04:00:49 GMT
Timestamp: 1411358460

Thanks

Paul

------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net<mailto:Sipp-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/sipp-users






------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk



_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net<mailto:Sipp-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/sipp-users


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 This e-mail is intended only for the named recipient(s) and may contain 
information that is otherwise privileged, confidential and/or exempt from 
disclosure under applicable law. No waiver of privilege, confidence, or 
otherwise is intended by virtue of communication via the internet. Any 
unauthorized use, dissemination or copying is strictly prohibited. If you have 
received this e-mail in error, or are not the named as a recipient, please 
immediately notify the sender and destroy all copies of this e-mail. 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to