-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added regexp support for response codes
Now the regexp_match attribute should also work for response codes. Example: <recv response="^18" regexp_match="true" optional="true">
- Loading branch information
Showing
8 changed files
with
140 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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 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,16 @@ | ||
#!/bin/sh | ||
# This regression test is a part of SIPp. | ||
# Author: Petr Cisar | ||
. "`dirname "$0"`/../functions"; init | ||
|
||
# uac.xml checks reception of regex-based responses | ||
sippbg -sn uas -i 127.0.0.1 -p 5070 -m 1 | ||
sippbg -sf uac.xml -i 127.0.0.1 -m 1 127.0.0.1:5070 | ||
job2=$! | ||
|
||
# If job2 did not finish, we have failure. | ||
if /bin/kill -0 $job2 2>/dev/null; then | ||
fail | ||
else | ||
ok | ||
fi |
This file contains 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,77 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1"?> | ||
<!DOCTYPE scenario SYSTEM "sipp.dtd"> | ||
<scenario> | ||
<send retrans="500"> | ||
<![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=[pid]SIPpTag00[call_number] | ||
To: [service] <sip:[service]@[remote_ip]:[remote_port]> | ||
Call-ID: [call_id] | ||
CSeq: 1 INVITE | ||
Contact: sip:sipp@[local_ip]:[local_port] | ||
Max-Forwards: 70 | ||
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> | ||
|
||
<!-- Test regular response code (no wildcard) --> | ||
<recv response="100" optional="true"/> | ||
|
||
<!-- Test regex 18x response code --> | ||
<recv response="^18.$" regexp_match="true" optional="true"/> | ||
|
||
<!-- Make sure that no match also works --> | ||
<recv response="^6" regexp_match="true" optional="true"/> | ||
|
||
<!-- Test a simple prefix match on response code, it should also work --> | ||
<recv response="^2" regexp_match="true" rtd="true"></recv> | ||
|
||
<send> | ||
<![CDATA[ | ||
ACK 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=[pid]SIPpTag00[call_number] | ||
To: [service] <sip:[service]@[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> | ||
|
||
<pause/> | ||
|
||
<send retrans="500"> | ||
<![CDATA[ | ||
BYE 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=[pid]SIPpTag00[call_number] | ||
To: [service] <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] | ||
Call-ID: [call_id] | ||
CSeq: 4 BYE | ||
Contact: sip:sipp@[local_ip]:[local_port] | ||
Max-Forwards: 70 | ||
Content-Length: 0 | ||
]]> | ||
</send> | ||
|
||
<recv response="200" crlf="true"/> | ||
|
||
</scenario> |
This file contains 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 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 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 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 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