Hello,

I'm having trouble with the use of linux environmental variables from within 
SIPp.
The version in use is: SIPp v3.4-beta1 (aka v3.3.990)

The goal is injecting a custom header into a SIP invite which contains a SHA256 
hash of the Caller ID.
For testing purpose, I've made the following script.
This script generates an invite, I make use of the auto generated caller_id.
The SHA256 hash calculated from this caller_id should end up being the value of 
[sign], however this does not work.
All the used linux environmental variables are pre-set and logging to 
/tmp/sign_key.log is just for the example and debugging.

$VAR0 = pre-set to "empty_VAR0"
$VAR1 = pre-set to "empty_VAR1"

command parameters are:
./sipp -m 1 -sf scripts/call_id_gen.xml 127.0.0.1 -key "sign" "$VAR0"


What does work is:
- internal variable [sign] matches $VAR0
- external SHA hash from [call_id] calculation (hash changes every run and 
matches CID on doublecheck)

What doesn't work is:
- setting $VAR0 or $VAR1 from an exec command (VAR0 should contain the hash and 
VAR1 should be "setting_VAR1")

Has anyone encountered this problem earlier?
Or is there better way of directly putting my SHA hash into the [sign] variable?

Thanks in advance, Stan




### After one run the logfile contains:

action_1
1-6110@192.168.11.54
2v2KSNRxRjpEZvMSFCsLd++pHVD540XLri8jBE+woGU
action_2
action_3
VAR0_eq empty_VAR0
sign_eq empty_VAR0
VAR1_eq empty_VAR1



### used XML scenario:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="Generate sign_key">

<send lost="100">
    <![CDATA[

      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
      To: sut <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 1 INVITE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      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 [rtpstream_audio_port] RTP/AVP 8
      a=rtpmap:8 PCMA/8000

      ]]>
</send>


<nop>
   <action>
      <exec command="echo action_1 >> /tmp/sign_key.log " />
      <exec command="echo \"[call_id]\" >> /tmp/sign_key.log " />
      <exec command="echo \"[call_id]\" | openssl dgst -sha256 -binary | base64 
| cut -d\"=\" -f1 - >> /tmp/sign_key.log " />
    </action>
</nop>

<pause milliseconds="1000"/>

<nop>
   <action>
      <exec command="echo action_2 >> /tmp/sign_key.log " />
      <exec command="VAR0=$\(echo \"[call_id]\" | openssl dgst -sha256 -binary 
| base64 | cut -d\"=\" -f1 - \) " />
      <exec command="VAR1=setting_VAR1 " />
   </action>
</nop>

<pause milliseconds="1000"/>

<nop>
   <action>
      <exec command="echo action_3 >> /tmp/sign_key.log " />
      <exec command="echo VAR0_eq $VAR0 >> /tmp/sign_key.log " />
      <exec command="echo sign_eq \"[sign]\" >> /tmp/sign_key.log " />
      <exec command="echo VAR1_eq $VAR1 >> /tmp/sign_key.log " />
    </action>
</nop>


</scenario>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to