TT#116101 bin/generate_test_tt2.py: more rules

* cseq: use \d+ since sems can use random and CE/PRO are different
* support alias_numbers
* numbers on display names

Change-Id: I7f94718cd9363a20124baae51347763dbd3fb234
mr10.0
Victor Seva 5 years ago
parent 5dc37b7886
commit 212a7075dd

@ -108,6 +108,12 @@ class Generator:
r"\1:\2[% {}.{} %]\3".format(tt, field),
)
)
rules.append(
(
r"\"{}\"".format(subs[field]),
'"[% {}.{} %]"'.format(tt, field),
)
)
def sdp_rule(val, tt):
rules.append(
@ -189,6 +195,13 @@ class Generator:
add_sip(resp, f"scenarios.{idx}.responders.{jdx}")
for key in ids[id_dom]:
sip_rule(ids[id_dom][key], f"{id_dom}.{key}", "phone_number")
if "alias_numbers" in ids[id_dom][key]:
for idx, alias in enumerate(ids[id_dom][key]["alias_numbers"]):
sip_rule(
alias,
f"{id_dom}.{key}.alias_numbers.{idx}",
"phone_number",
)
return rules
def __init__(self, _hdrs, _msg, _ids):
@ -237,6 +250,8 @@ class Generator:
elif hdr == "contact":
rules.append((r"expires=[1-9]\d*", r"expires=\\d+"))
rules.append((r";ngcpct=[^;>]+", r";ngcpct=[^;]+"))
elif hdr == "cseq":
rules.append((r":\s+\d+", r": \\d+"))
for rule in rules:
line = re.sub(rule[0], rule[1], line, flags=re.IGNORECASE)
return line

@ -2,34 +2,34 @@ messages:
- - 'SIP/2.0 401 Unauthorized'
- 'From: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'CSeq: 1 REGISTER'
- 'CSeq: \d+ REGISTER'
- 'WWW-Authenticate: Digest realm="auth-fail.scenarios.test", nonce="[^"]+"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 401 Unauthorized'
- 'From: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'CSeq: 2 REGISTER'
- 'CSeq: \d+ REGISTER'
- 'WWW-Authenticate: Digest realm="auth-fail.scenarios.test", nonce="[^"]+"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 401 Unauthorized'
- 'From: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'CSeq: 3 REGISTER'
- 'CSeq: \d+ REGISTER'
- 'WWW-Authenticate: Digest realm="auth-fail.scenarios.test", nonce="[^"]+"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 401 Unauthorized'
- 'From: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'CSeq: 4 REGISTER'
- 'CSeq: \d+ REGISTER'
- 'WWW-Authenticate: Digest realm="auth-fail.scenarios.test", nonce="[^"]+"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 403 Try again later'
- 'From: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.username %]@auth-fail.scenarios.test>;tag=[\w-]+'
- 'CSeq: 5 REGISTER'
- 'CSeq: \d+ REGISTER'
- 'Server: Sipwise NGCP LB'
- 'Content-Length: 0'

@ -2,13 +2,13 @@ messages:
- - 'SIP/2.0 100 Trying'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_foreign_dom_scenarios_test.testuser1003.phone_number %]@incoming-foreign-dom.scenarios.test>'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Server: Sipwise NGCP LB'
- 'Content-Length: 0'
- - 'SIP/2.0 101 Connecting'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_foreign_dom_scenarios_test.testuser1003.phone_number %]@incoming-foreign-dom.scenarios.test>'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 180 Ringing'
@ -17,7 +17,7 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_foreign_dom_scenarios_test.testuser1003.phone_number %]@incoming-foreign-dom.scenarios.test>;tag=[\w-]+'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Content-Length: 0'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- - 'SIP/2.0 200 OK'
@ -26,7 +26,7 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_foreign_dom_scenarios_test.testuser1003.phone_number %]@incoming-foreign-dom.scenarios.test>;tag=[\w-]+'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Content-Type: application/sdp'
- 'Content-Length: \d+'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
@ -47,5 +47,5 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_foreign_dom_scenarios_test.testuser1003.phone_number %]@incoming-foreign-dom.scenarios.test>;tag=[\w-]+'
- 'CSeq: 2 BYE'
- 'CSeq: \d+ BYE'
- 'Content-Length: 0'

@ -5,7 +5,7 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+;did=[^;]+>'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@incoming-foreign-dom.scenarios.test>'
- 'CSeq: 10 INVITE'
- 'CSeq: \d+ INVITE'
- 'P-Asserted-Identity: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>'
- 'Content-Type: application/sdp'
- 'Content-Length: \d+'
@ -27,7 +27,7 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+>'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@incoming-foreign-dom.scenarios.test>;tag=[\w-]+'
- 'CSeq: 10 ACK'
- 'CSeq: \d+ ACK'
- 'Content-Length: 0'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- - 'BYE sip:[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %];transport=UDP SIP/2.0'
@ -36,6 +36,6 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+>'
- 'From: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@incoming-foreign-dom.scenarios.test>;tag=[\w-]+'
- 'CSeq: 11 BYE'
- 'CSeq: \d+ BYE'
- 'P-Asserted-Identity: <sip:[% scenarios.0.username %]@incoming-foreign-dom.external.test>'
- 'Content-Length: 0'

@ -2,7 +2,7 @@ messages:
- - 'SIP/2.0 100 Trying'
- 'From: <sip:[% scenarios.0.username %]@incoming-hih.host0.peer.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_hih_scenarios_test.testuser1003.phone_number %]@incoming-hih.scenarios.test>'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Server: Sipwise NGCP LB'
- 'Content-Length: 0'
- - 'SIP/2.0 180 Ringing'
@ -11,7 +11,7 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <sip:[% scenarios.0.username %]@incoming-hih.host0.peer.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_hih_scenarios_test.testuser1003.phone_number %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Content-Length: 0'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- - 'SIP/2.0 200 OK'
@ -20,7 +20,7 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <sip:[% scenarios.0.username %]@incoming-hih.host0.peer.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_hih_scenarios_test.testuser1003.phone_number %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Content-Type: application/sdp'
- 'Content-Length: \d+'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
@ -41,5 +41,5 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <sip:[% scenarios.0.username %]@incoming-hih.host0.peer.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% incoming_hih_scenarios_test.testuser1003.phone_number %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'CSeq: 2 BYE'
- 'CSeq: \d+ BYE'
- 'Content-Length: 0'

@ -5,7 +5,7 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+;did=[^;]+>'
- 'From: <sip:[% scenarios.0.username %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.1.username %]@incoming-hih.scenarios.test>'
- 'CSeq: 10 INVITE'
- 'CSeq: \d+ INVITE'
- 'History-Info: <sip:\+4313012026@incoming-hih.scenarios.test;user=phone\?privacy=history>;index=1'
- 'History-Info: <sip:\+[% incoming_hih_scenarios_test.testuser1003.phone_number %]@incoming-hih.scenarios.test;user=phone;cause=302\?privacy=id>;index=1.1'
- 'History-Info: <sip:\+[% incoming_hih_scenarios_test.testuser1002.phone_number %]@incoming-hih.scenarios.test:5060;user=phone;cause=302>;index=1.1.1'
@ -30,7 +30,7 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+>'
- 'From: <sip:[% scenarios.0.username %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.1.username %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'CSeq: 10 ACK'
- 'CSeq: \d+ ACK'
- 'Content-Length: 0'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- - 'BYE sip:[% scenarios.0.responders.1.ip %]:[% scenarios.0.responders.1.port %];transport=UDP SIP/2.0'
@ -39,6 +39,6 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+>'
- 'From: <sip:[% scenarios.0.username %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.1.username %]@incoming-hih.scenarios.test>;tag=[\w-]+'
- 'CSeq: 11 BYE'
- 'CSeq: \d+ BYE'
- 'P-Asserted-Identity: <sip:[% scenarios.0.username %]@incoming-hih.scenarios.test>'
- 'Content-Length: 0'

@ -2,20 +2,20 @@ messages:
- - 'SIP/2.0 100 Trying'
- 'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+'
- 'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]>'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Server: Sipwise NGCP LB'
- 'Content-Length: 0'
- - 'SIP/2.0 407 Proxy Authentication Required'
- 'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+'
- 'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]>;tag=[\w-]+'
- 'CSeq: 1 INVITE'
- 'CSeq: \d+ INVITE'
- 'Proxy-Authenticate: Digest realm="invite-redirect-tel-uri.scenarios.test", nonce="[^"]+"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 100 Trying'
- 'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+'
- 'To: <tel:00[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]>'
- 'CSeq: 2 INVITE'
- 'CSeq: \d+ INVITE'
- 'Server: Sipwise NGCP LB'
- 'Content-Length: 0'
- - 'SIP/2.0 180 Ringing'
@ -24,7 +24,7 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+'
- 'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]>;tag=[\w-]+'
- 'CSeq: 2 INVITE'
- 'CSeq: \d+ INVITE'
- 'Content-Length: 0'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- - 'SIP/2.0 200 OK'
@ -33,7 +33,7 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+'
- 'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]>;tag=[\w-]+'
- 'CSeq: 2 INVITE'
- 'CSeq: \d+ INVITE'
- 'Content-Type: application/sdp'
- 'Content-Length: \d+'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
@ -54,5 +54,5 @@ messages:
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;socket=udp:[% server_ip %]:5060>'
- 'From: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]>;tag=[\w-]+'
- 'To: <tel:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]>;tag=[\w-]+'
- 'CSeq: 3 BYE'
- 'CSeq: \d+ BYE'
- 'Content-Length: 0'

@ -5,7 +5,7 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+;did=[^;]+>'
- 'From: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-redirect-tel-uri.scenarios.test>'
- 'CSeq: 10 INVITE'
- 'CSeq: \d+ INVITE'
- 'P-Asserted-Identity: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>'
- 'Content-Type: application/sdp'
- 'Content-Length: \d+'
@ -24,5 +24,5 @@ messages:
- - 'ACK sip:[% scenarios.0.responders.0.username %]@[% scenarios.0.responders.0.ip %]:[% scenarios.0.responders.0.port %] SIP/2.0'
- 'From: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'CSeq: 10 ACK'
- 'CSeq: \d+ ACK'
- 'Content-Length: 0'

@ -5,7 +5,7 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+;did=[^;]+>'
- 'From: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.1.username %]@invite-redirect-tel-uri.scenarios.test>'
- 'CSeq: 10 INVITE'
- 'CSeq: \d+ INVITE'
- 'P-Asserted-Identity: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>'
- 'Diversion: <sip:\+[% invite_redirect_tel_uri_scenarios_test.testuser1001.phone_number %]@invite-redirect-tel-uri.scenarios.test>;privacy=off;counter=1'
- 'History-Info: <sip:[% scenarios.0.responders.0.username %]@invite-redirect-tel-uri.scenarios.test:5060;user=phone\?Reason=SIP%3bcause%3d302>;index=1'
@ -30,7 +30,7 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+>'
- 'From: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.1.username %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'CSeq: 10 ACK'
- 'CSeq: \d+ ACK'
- 'Content-Length: 0'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- - 'BYE sip:[% scenarios.0.responders.1.ip %]:[% scenarios.0.responders.1.port %];transport=UDP SIP/2.0'
@ -39,6 +39,6 @@ messages:
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+>'
- 'From: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.1.username %]@invite-redirect-tel-uri.scenarios.test>;tag=[\w-]+'
- 'CSeq: 11 BYE'
- 'CSeq: \d+ BYE'
- 'P-Asserted-Identity: <sip:[% invite_redirect_tel_uri_scenarios_test.testuser1000.phone_number %]@invite-redirect-tel-uri.scenarios.test>'
- 'Content-Length: 0'

@ -17,6 +17,11 @@ invite_callforward_scenarios_test:
phone_number: "4311049"
sn: 1049
uuid: 9f6e11aa-98e0-41e5-b1f4-a06666a76f87
alias_numbers:
- phone_number: "4311013"
ac: "1"
cc: "43"
sn: 1013
testuser1003:
ac: "1"
cc: "43"

@ -2,14 +2,14 @@ messages:
- - 'SIP/2.0 401 Unauthorized'
- 'From: <sip:[% scenarios.0.responders.0.username %]@invite-callforward.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-callforward.scenarios.test>;tag=[\w-]+'
- 'CSeq: 1 REGISTER'
- 'CSeq: \d+ REGISTER'
- 'WWW-Authenticate: Digest realm="invite-callforward.scenarios.test", nonce="[^"]+"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 200 OK'
- 'From: <sip:[% scenarios.0.responders.0.username %]@invite-callforward.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-callforward.scenarios.test>;tag=[\w-]+'
- 'CSeq: 2 REGISTER'
- 'CSeq: \d+ REGISTER'
- 'Contact: <sip:[% scenarios.0.responders.1.username %]@[% scenarios.0.responders.1.ip %]:[% scenarios.0.responders.1.port %]>;expires=\d+;received="sip:[% scenarios.0.responders.1.ip %]:[% scenarios.0.responders.1.port %]"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'

@ -0,0 +1,189 @@
----------------------------------------------- 2021-07-19 16:24:57.700106
UDP message sent (658 bytes):
INVITE sip:testuser1003@invite-allowedcli-match-alias.scenarios.test SIP/2.0
Via: SIP/2.0/UDP 10.20.29.2:51619;branch=z9hG4bK-176808-1-0
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 1 INVITE
Contact: <sip:testuser1002@10.20.29.2:51619>
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 144
v=0
o=user1 53655765 2353687637 IN IP4 10.20.29.2192.168.1.152
s=-
c=IN IP4 10.20.29.2
t=0 0
m=audio 45047 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=ptime:50
----------------------------------------------- 2021-07-19 16:24:57.700809
UDP message received [398] bytes :
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.20.29.2:51619;branch=z9hG4bK-176808-1-0;rport=51619
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 1 INVITE
Server: Sipwise NGCP LB 9.X
Content-Length: 0
----------------------------------------------- 2021-07-19 16:24:57.771346
UDP message received [593] bytes :
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 10.20.29.2:51619;rport=51619;branch=z9hG4bK-176808-1-0
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>;tag=95c37a12bff1a2c36d72bf8333176544.78550000
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 1 INVITE
Proxy-Authenticate: Digest realm="invite-allowedcli-match-alias.scenarios.test", nonce="YPWMZWD1izmaagckORb3dRbLlq90u7JE"
Server: Sipwise NGCP Proxy 9.X
Content-Length: 0
----------------------------------------------- 2021-07-19 16:24:57.772324
UDP message sent (536 bytes):
ACK sip:testuser1003@invite-allowedcli-match-alias.scenarios.test:5060 SIP/2.0
Via: SIP/2.0/UDP 10.20.29.2:51619;rport=51619;branch=z9hG4bK-176808-1-0
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>;tag=95c37a12bff1a2c36d72bf8333176544.78550000
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 1 ACK
Contact: <sip:testuser1002@10.20.29.2:51619>
Max-Forwards: 70
Content-Length: 0
----------------------------------------------- 2021-07-19 16:24:58.285523
UDP message sent (892 bytes):
INVITE sip:testuser1003@invite-allowedcli-match-alias.scenarios.test SIP/2.0
Via: SIP/2.0/UDP 10.20.29.2:51619;branch=z9hG4bK-176808-1-5
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 2 INVITE
Contact: <sip:testuser1002@10.20.29.2:51619>
Max-Forwards: 70
Proxy-Authorization: Digest username="testuser1002",realm="invite-allowedcli-match-alias.scenarios.test",uri="sip:192.168.1.152:5060",nonce="YPWMZWD1izmaagckORb3dRbLlq90u7JE",response="9ad9b9e784227b71b9e9f5288bce1ec1",algorithm=MD5
Content-Type: application/sdp
Content-Length: 144
v=0
o=user1 53655765 2353687637 IN IP4 10.20.29.2
s=-
c=IN IP4 10.20.29.2
t=0 0
m=audio 45047 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=ptime:50
----------------------------------------------- 2021-07-19 16:24:58.287587
UDP message received [398] bytes :
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.20.29.2:51619;branch=z9hG4bK-176808-1-5;rport=51619
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 2 INVITE
Server: Sipwise NGCP LB 9.X
Content-Length: 0
----------------------------------------------- 2021-07-19 16:24:59.175987
UDP message received [968] bytes :
SIP/2.0 180 Ringing
Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=176808SIPpTag001;did=b39.f87;ice_caller=strip;ice_callee=strip;aset=50;rtpprx=yes;vsf=dWpydikdITIkKyBZPjYDF2x/AEFwcngsbUNsdH8hf2l+YgAMWGtJXyslbXxtVix2a2NrJGBkWUt2ByYlAQ-->
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>
Record-Route: <sip:192.168.1.152;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>
Via: SIP/2.0/UDP 10.20.29.2:51619;rport=51619;branch=z9hG4bK-176808-1-5
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>;tag=76C2584B-60F58B3A000EA551-3D1BA700
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 2 INVITE
Content-Length: 0
Contact: <sip:ngcp-lb@192.168.1.152:5060;ngcpct=7369703a3132372e302e302e313a353038303b707278726f7574653d31>
----------------------------------------------- 2021-07-19 16:24:59.763506
UDP message received [1172] bytes :
SIP/2.0 200 OK
Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=176808SIPpTag001;did=b39.f87;ice_caller=strip;ice_callee=strip;aset=50;rtpprx=yes;vsf=dWpydikdITIkKyBZPjYDF2x/AEFwcngsbUNsdH8hf2l+YgAMWGtJXyslbXxtVix2a2NrJGBkWUt2ByYlAQ-->
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>
Record-Route: <sip:192.168.1.152;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>
Via: SIP/2.0/UDP 10.20.29.2:51619;rport=51619;branch=z9hG4bK-176808-1-5
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>;tag=76C2584B-60F58B3A000EA551-3D1BA700
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 2 INVITE
Content-Type: application/sdp
Content-Length: 176
Contact: <sip:ngcp-lb@192.168.1.152:5060;ngcpct=7369703a3132372e302e302e313a353038303b707278726f7574653d31>
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.152
s=-
c=IN IP4 192.168.1.152
t=0 0
m=audio 30204 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=sendrecv
a=rtcp:30205
a=ptime:50
----------------------------------------------- 2021-07-19 16:24:59.763982
UDP message sent (963 bytes):
ACK sip:ngcp-lb@192.168.1.152:5060;ngcpct=7369703a3132372e302e302e313a353038303b707278726f7574653d31 SIP/2.0
Via: SIP/2.0/UDP 10.20.29.2:51619;branch=z9hG4bK-176808-1-10
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>;tag=76C2584B-60F58B3A000EA551-3D1BA700
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
Route: <sip:192.168.1.152;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>, <sip:127.0.0.1;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>, <sip:127.0.0.1:5062;lr=on;ftag=176808SIPpTag001;did=b39.f87;ice_caller=strip;ice_callee=strip;aset=50;rtpprx=yes;vsf=dWpydikdITIkKyBZPjYDF2x/AEFwcngsbUNsdH8hf2l+YgAMWGtJXyslbXxtVix2a2NrJGBkWUt2ByYlAQ-->
CSeq: 2 ACK
Contact: <sip:testuser1002@10.20.29.2:51619>
Max-Forwards: 70
Content-Length: 0
----------------------------------------------- 2021-07-19 16:25:01.280091
UDP message sent (963 bytes):
BYE sip:ngcp-lb@192.168.1.152:5060;ngcpct=7369703a3132372e302e302e313a353038303b707278726f7574653d31 SIP/2.0
Via: SIP/2.0/UDP 10.20.29.2:51619;branch=z9hG4bK-176808-1-14
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>;tag=76C2584B-60F58B3A000EA551-3D1BA700
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 3 BYE
Contact: <sip:testuser1002@10.20.29.2:51619>
Route: <sip:192.168.1.152;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>, <sip:127.0.0.1;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>, <sip:127.0.0.1:5062;lr=on;ftag=176808SIPpTag001;did=b39.f87;ice_caller=strip;ice_callee=strip;aset=50;rtpprx=yes;vsf=dWpydikdITIkKyBZPjYDF2x/AEFwcngsbUNsdH8hf2l+YgAMWGtJXyslbXxtVix2a2NrJGBkWUt2ByYlAQ-->
Max-Forwards: 70
Content-Length: 0
----------------------------------------------- 2021-07-19 16:25:02.243551
UDP message received [798] bytes :
SIP/2.0 200 OK
Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=176808SIPpTag001;vsf=dWpydikdITIkKyBZPjYDF2x/AEFwcngsbUNsdH8hf2l+YgAMWGtJXyslbXxtVix2a2NrJGBkWUt2ByYlAQ--;rtpprx=yes>
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>
Record-Route: <sip:192.168.1.152;r2=on;lr=on;ftag=176808SIPpTag001;ngcplb=yes;nat=yes;socket=udp:192.168.1.152:5060>
Via: SIP/2.0/UDP 10.20.29.2:51619;rport=51619;branch=z9hG4bK-176808-1-14
From: "4311013" <sip:testuser1002@invite-allowedcli-match-alias.scenarios.test>;tag=176808SIPpTag001
To: <sip:testuser1003@invite-allowedcli-match-alias.scenarios.test>;tag=76C2584B-60F58B3A000EA551-3D1BA700
Call-ID: NGCP%invite_allowedcli_match_alias%///1-176808@10.20.29.2
CSeq: 3 BYE
Content-Length: 0

@ -0,0 +1,57 @@
messages:
- - 'SIP/2.0 100 Trying'
- 'From: "[% invite_callforward_scenarios_test.testuser1002.alias_numbers.0.phone_number %]" <sip:[% scenarios.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-allowedcli-match-alias.scenarios.test>'
- 'CSeq: \d+ INVITE'
- 'Server: Sipwise NGCP LB'
- 'Content-Length: 0'
- - 'SIP/2.0 407 Proxy Authentication Required'
- 'From: "[% invite_callforward_scenarios_test.testuser1002.alias_numbers.0.phone_number %]" <sip:[% scenarios.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'CSeq: \d+ INVITE'
- 'Proxy-Authenticate: Digest realm="invite-allowedcli-match-alias.scenarios.test", nonce="[^"]+"'
- 'Server: Sipwise NGCP Proxy'
- 'Content-Length: 0'
- - 'SIP/2.0 100 Trying'
- 'From: "[% invite_callforward_scenarios_test.testuser1002.alias_numbers.0.phone_number %]" <sip:[% scenarios.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-allowedcli-match-alias.scenarios.test>'
- 'CSeq: \d+ INVITE'
- 'Server: Sipwise NGCP LB'
- 'Content-Length: 0'
- - 'SIP/2.0 180 Ringing'
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+;did=[^;]+;ice_caller=strip;ice_callee=strip;aset=\d+;rtpprx=yes;vsf=[^;]+>'
- 'Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: "[% invite_callforward_scenarios_test.testuser1002.alias_numbers.0.phone_number %]" <sip:[% scenarios.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'CSeq: \d+ INVITE'
- 'Content-Length: 0'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- - 'SIP/2.0 200 OK'
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+;did=[^;]+;ice_caller=strip;ice_callee=strip;aset=\d+;rtpprx=yes;vsf=[^;]+>'
- 'Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: "[% invite_callforward_scenarios_test.testuser1002.alias_numbers.0.phone_number %]" <sip:[% scenarios.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'CSeq: \d+ INVITE'
- 'Content-Type: application/sdp'
- 'Content-Length: \d+'
- 'Contact: <sip:ngcp-lb@[% server_ip %]:5060;ngcpct=[^;]+>'
- 'v=0'
- 'o=user1 \d+ \d+ IN IP4 [% server_ip %]'
- 's=-'
- 'c=IN IP4 [% server_ip %]'
- 't=0 0'
- 'm=audio \d+ RTP/AVP 8'
- 'a=rtpmap:8 PCMA/8000'
- 'a=sendrecv'
- 'a=rtcp:\d+'
- 'a=ptime:50'
- - 'SIP/2.0 200 OK'
- 'Record-Route: <sip:127.0.0.1:5062;lr=on;ftag=[^;]+;vsf=[^;]+;rtpprx=yes>'
- 'Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'Record-Route: <sip:[% server_ip %];r2=on;lr=on;ftag=[^;]+;ngcplb=yes;nat=yes;socket=udp:[% server_ip %]:5060>'
- 'From: "[% invite_callforward_scenarios_test.testuser1002.alias_numbers.0.phone_number %]" <sip:[% scenarios.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'To: <sip:[% scenarios.0.responders.0.username %]@invite-allowedcli-match-alias.scenarios.test>;tag=[\w-]+'
- 'CSeq: \d+ BYE'
- 'Content-Length: 0'

@ -242,3 +242,14 @@ def test_mix(generate_test_tt2_file, caplog):
assert check_filecontent(TT2_FILE.format("mix", "00"), res.out_file)
assert res.returncode == 0
def test_mix_alias(generate_test_tt2_file, caplog):
caplog.set_level(logging.DEBUG)
res = generate_test_tt2_file(
IDS_FILE.format("mix"),
MSG_FILE.format("mix", "01"),
)
assert check_filecontent(TT2_FILE.format("mix", "01"), res.out_file)
assert res.returncode == 0

Loading…
Cancel
Save