-
Notifications
You must be signed in to change notification settings - Fork 417
Enable CSV field and computed variable substitution in recv timeout parameters #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
7
commits into
master
Choose a base branch
from
copilot/fix-801
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
aab495b
Initial plan
Copilot 325da62
Implement support for CSV field and variable substitution in recv tim…
Copilot c7e15f0
Fix timeout variable resolution and add comprehensive regression test
Copilot 03a2f3f
Enable CSV field and computed variable substitution in recv timeout p…
Copilot 7dba0f0
Address PR review comments: fix linting, remove debug files, deduplic…
Copilot 138cd4c
Improve timeout variable testing and fix newline issue
Copilot e49bc84
Remove unused test files and finalize regression test suite
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
# Test to verify timeout variable functionality works correctly | ||
. "`dirname "$0"`/../functions"; init | ||
|
||
# Create test data with different timeout values | ||
echo "SEQUENTIAL" > test_data.csv | ||
echo "call1;user1;100;1000" >> test_data.csv # 1000ms timeout | ||
echo "call2;user2;200;500" >> test_data.csv # 500ms timeout | ||
|
||
# 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" | ||
|
||
# Test 3: Verify timeout variable resolution doesn't cause parse errors | ||
# Run with very short timeout to minimize test time, looking for variable resolution errors | ||
echo "SEQUENTIAL" > timeout_test.csv | ||
echo "call1;user1;100;100" >> timeout_test.csv # 100ms timeout for quick test | ||
timeout 5 "`get_sipp`" -sf uac_csv.xml -inf timeout_test.csv -p 5072 -m 1 127.0.0.1 -nostdin -timeout 2 2>&1 | grep -iE "(invalid.*timeout|timeout.*not.*valid|variable.*error)" && fail "timeout variable resolution failed" | ||
|
||
# Test 4: Verify computed variable timeout doesn't cause parse errors | ||
echo "SEQUENTIAL" > var_test.csv | ||
echo "call1;user1;100;150" >> var_test.csv # 150ms timeout for quick test | ||
timeout 5 "`get_sipp`" -sf uac_variable.xml -inf var_test.csv -p 5073 -m 1 127.0.0.1 -nostdin -timeout 2 2>&1 | grep -iE "(invalid.*timeout|timeout.*not.*valid|variable.*error)" && fail "variable timeout resolution failed" | ||
|
||
# Clean up | ||
rm -f test_data.csv timeout_test.csv var_test.csv | ||
|
||
ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.