Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ class call : virtual public task, virtual public listener, public virtual socket
char* createSendingMessage(char* src, int P_index, bool skip_sanity=false);
char* createSendingMessage(SendingMessage*src, int P_index, char *msg_buffer, int buflen, int *msgLen=nullptr);

// Helper method to resolve timeout values with variables
unsigned int resolveTimeoutValue(const char* timeout_str);

// method for the management of unexpected messages
bool checkInternalCmd(char* cmd); // check of specific internal command
// received from the twin socket
Expand Down
2 changes: 2 additions & 0 deletions include/scenario.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class message
unsigned int retrans_delay;
/* The receive/send timeout. */
unsigned int timeout;
/* The timeout string for variable substitution */
char * timeout_str;

/* 3pcc extended mode: if this is a sendCmd */
char * peer_dest;
Expand Down
9 changes: 9 additions & 0 deletions regress/github-#0544/debuglsrtpafile_uac

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added this file blindly with git add. It should be removed and added to .gitignore. Same goes for the other files added in this directory.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the accidentally committed debug files and added .gitignore patterns to prevent similar files from being committed in the future. (7dba0f0)

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
audio_found : 1
primary_audio_cryptotag : 1
secondary_audio_cryptotag : 2
primary_audio_cryptosuite : AES_CM_128_HMAC_SHA1_80
secondary_audio_cryptosuite : AES_CM_128_HMAC_SHA1_32
primary_audio_cryptokeyparams : Ijmgrr3jQU/Z2HKBVPj4SNgR0QHH64i4KOCkeyA3
secondary_audio_cryptokeyparams : UKUBHcjWoG0prpbzZrDleoWhWgRJG98Dlw0TZ4cZ
primary_unencrypted_audio_srtp : 0
secondary_unencrypted_audio_srtp: 0
9 changes: 9 additions & 0 deletions regress/github-#0544/debuglsrtpvfile_uac
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
video_found : 1
primary_video_cryptotag : 1
secondary_video_cryptotag : 2
primary_video_cryptosuite : AES_CM_128_HMAC_SHA1_80
secondary_video_cryptosuite : AES_CM_128_HMAC_SHA1_32
primary_video_cryptokeyparams : W2bmaZ2IKPX+JSEu91+A9a3ImZKjt9II46MqQg7+
secondary_video_cryptokeyparams : 1Mh4k9bF8y/NiK813haiLO0ZnvXdG9mEy9YyLG+V
primary_unencrypted_video_srtp : 0
secondary_unencrypted_video_srtp: 0
29 changes: 29 additions & 0 deletions regress/github-#0544/srtpctxdebugfile_uac
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
call::init(): (a) TX-UAC-AUDIO SRTP context - CLIENT setting SRTP header size to 12
call::init(): (a) TX-UAC-VIDEO SRTP context - CLIENT setting SRTP header size to 12
call::init(): (b) RX-UAC-AUDIO SRTP context - CLIENT setting SRTP header size to 12
call::init(): (b) RX-UAC-VIDEO SRTP context - CLIENT setting SRTP header size to 12
call::createSendingMessage(): E_Message_RTPStream_Audio_Port: 6000
call::createSendingMessage(): E_Message_CryptoTag1Audio() - PRIMARY - CLIENT: 1
call::createSendingMessage(): E_Message_CryptoSuiteAesCm128Sha1801Audio() - PRIMARY - CLIENT
call::createSendingMessage(): Marking preferred OFFER cryptosuite...
call::createSendingMessage(): E_Message_CryptoKeyParams1Audio() - PRIMARY - CLIENT - component offset:0
call::createSendingMessage(): E_Message_CryptoKeyParams1Audio() - PRIMARY - CLIENT - generating new concatenated base64-encoded master key/salt:Ijmgrr3jQU/Z2HKBVPj4SNgR0QHH64i4KOCkeyA3
call::createSendingMessage(): E_Message_CryptoTag2Audio() - SECONDARY - CLIENT: 2
call::createSendingMessage(): E_Message_CryptoSuiteAesCm128Sha1322Audio() - SECONDARY - CLIENT
call::createSendingMessage(): E_Message_CryptoKeyParams2Audio() - SECONDARY - CLIENT - component offset:0
call::createSendingMessage(): E_Message_CryptoKeyParams2Audio() - SECONDARY - CLIENT - generating new concatenated base64-encoded master key/salt:UKUBHcjWoG0prpbzZrDleoWhWgRJG98Dlw0TZ4cZ
call::createSendingMessage(): E_Message_RTPStream_Audio_Port: 6001
call::createSendingMessage(): E_Message_RTPStream_Video_Port: 6002
call::createSendingMessage(): E_Message_CryptoTag1Video() - PRIMARY - CLIENT: 1
call::createSendingMessage(): E_Message_CryptoSuiteAesCm128Sha1801Video() - PRIMARY - CLIENT
call::createSendingMessage(): Marking preferred OFFER cryptosuite...
call::createSendingMessage(): E_Message_CryptoKeyParams1Video() - PRIMARY - CLIENT - component offset:0
call::createSendingMessage(): E_Message_CryptoKeyParams1Video() - PRIMARY - CLIENT - generating new concatenated base64-encoded master key/salt:W2bmaZ2IKPX+JSEu91+A9a3ImZKjt9II46MqQg7+
call::createSendingMessage(): E_Message_CryptoTag2Video() - SECONDARY - CLIENT: 2
call::createSendingMessage(): E_Message_CryptoSuiteAesCm128Sha1322Video() - SECONDARY - CLIENT
call::createSendingMessage(): E_Message_CryptoKeyParams2Video() - SECONDARY - CLIENT - component offset:0
call::createSendingMessage(): E_Message_CryptoKeyParams2Video() - SECONDARY - CLIENT - generating new concatenated base64-encoded master key/salt:1Mh4k9bF8y/NiK813haiLO0ZnvXdG9mEy9YyLG+V
call::createSendingMessage(): E_Message_RTPStream_Video_Port: 6003
call::createSendingMessage(): (b) RX-UAC-AUDIO SRTP context - ssrc:0x6b8b4567 address:127.0.0.2 port:6000
call::createSendingMessage(): (b) RX-UAC-VIDEO SRTP context - ssrc:0x6b8b4568 address:127.0.0.2 port:6002
call::createSendingMessage(): Switching session state: eNoSession --> eOfferSent
18 changes: 18 additions & 0 deletions regress/github-#0801/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh
# Simple test to demonstrate timeout variable functionality works
. "`dirname "$0"`/../functions"; init

# Test that scenarios with timeout variables can be parsed without errors
echo "SEQUENTIAL" > test_data.csv
echo "call1;user1;100;1000" >> test_data.csv

# Test 1: Parse scenario with CSV field timeout - should not produce parsing errors
timeout 3 "`get_sipp`" -sf uac_csv.xml -inf test_data.csv -p 5070 -m 0 127.0.0.1 2>&1 | grep -q "timeout.*field" && fail "parsing error with CSV field timeout"

# Test 2: Parse scenario with variable timeout - should not produce parsing errors
timeout 3 "`get_sipp`" -sf uac_variable.xml -inf test_data.csv -p 5071 -m 0 127.0.0.1 2>&1 | grep -q "timeout.*variable" && fail "parsing error with variable timeout"
Comment thread
orgads marked this conversation as resolved.

# Clean up
rm -f test_data.csv

ok

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include newline at the end of all new files.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added newlines to all XML files in the regression test directory. All files now end with proper newlines. (7dba0f0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed this file (run).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added missing newline to regress/github-#0801/run file.

65 changes: 65 additions & 0 deletions regress/github-#0801/uac_csv.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="UAC CSV timeout test">
<send retrans="500">
<![CDATA[
INVITE sip:[field1]@[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=[pid]SIPpTag00[call_number]
To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test - [field0]
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 [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>

<recv response="100" optional="true">
</recv>

<recv response="200" rtd="true">
</recv>

<send>
<![CDATA[
ACK sip:[field1]@[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=[pid]SIPpTag00[call_number]
To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Content-Length: 0
]]>
</send>

<!-- Test CSV field variable in timeout parameter - should wait [field3] milliseconds -->
<recv request="BYE" timeout="[field3]">
</recv>

<send>
<![CDATA[
200 OK SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
To: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
Call-ID: [call_id]
CSeq: [cseq] BYE
Content-Length: 0
]]>
</send>

</scenario>
72 changes: 72 additions & 0 deletions regress/github-#0801/uac_variable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="UAC Variable timeout test">
<nop>
<action>
<assignstr assign_to="timervalue" value="[field3]" />
<todouble assign_to="tmresult" variable="timervalue" />
</action>
</nop>

<send retrans="500">
<![CDATA[
INVITE sip:[field1]@[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=[pid]SIPpTag00[call_number]
To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 INVITE
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Subject: Performance Test - [field0]
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 [media_port] RTP/AVP 0
a=rtpmap:0 PCMU/8000
]]>
</send>

<recv response="100" optional="true">
</recv>

<recv response="200" rtd="true">
</recv>

<send>
<![CDATA[
ACK sip:[field1]@[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=[pid]SIPpTag00[call_number]
To: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: 1 ACK
Contact: sip:sipp@[local_ip]:[local_port]
Max-Forwards: 70
Content-Length: 0
]]>
</send>

<!-- Test computed variable in timeout parameter - should wait [$tmresult] milliseconds -->
<recv request="BYE" timeout="[$tmresult]">
</recv>

<send>
<![CDATA[
200 OK SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [field1] <sip:[field1]@[remote_ip]:[remote_port]>[peer_tag_param]
To: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
Call-ID: [call_id]
CSeq: [cseq] BYE
Content-Length: 0
]]>
</send>

</scenario>
65 changes: 65 additions & 0 deletions regress/github-#0801/uas_csv.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="UAS CSV timeout test">
<recv request="INVITE" crlf="true">
</recv>

<send>
<![CDATA[
SIP/2.0 100 Trying
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]

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

<recv request="ACK" rtd="true" crlf="true">
</recv>

<!-- Wait 1 second before sending BYE to test timeout -->
<pause milliseconds="1000"/>

<send retrans="500">
<![CDATA[
BYE sip:[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [last_To:]
To: [last_From:]
[last_Call-ID:]
CSeq: 1 BYE
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<recv response="200" crlf="true">
</recv>

</scenario>
65 changes: 65 additions & 0 deletions regress/github-#0801/uas_variable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="UAS Variable timeout test">
<recv request="INVITE" crlf="true">
</recv>

<send>
<![CDATA[
SIP/2.0 100 Trying
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:];tag=[pid]SIPpTag01[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]

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

<recv request="ACK" rtd="true" crlf="true">
</recv>

<!-- Wait 1 second before sending BYE to test timeout -->
<pause milliseconds="1000"/>

<send retrans="500">
<![CDATA[
BYE sip:[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: [last_To:]
To: [last_From:]
[last_Call-ID:]
CSeq: 1 BYE
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<recv response="200" crlf="true">
</recv>

</scenario>
Loading
Loading