Skip to content

Commit b378a9b

Browse files
committed
test: use RFC 5737 documentation IPs (203.0.113.0/24) in fixtures and tests
1 parent 8c2a6fa commit b378a9b

15 files changed

Lines changed: 25 additions & 25 deletions

examples/trunks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# --- Create SIP trunk ---
1414
sip = SipConfiguration()
1515
sip.username = "username"
16-
sip.host = "216.58.215.110"
16+
sip.host = "203.0.113.110"
1717
sip.port = 5060
1818
sip.codec_ids = [Codec.PCMU, Codec.PCMA]
1919
sip.transport_protocol_id = TransportProtocol.UDP

examples/voice_out_trunks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
update = VoiceOutTrunk.build(created.id)
6060
update.name = f"Updated Outbound Trunk {suffix}"
6161
update.authentication_method = CredentialsAndIpAuthenticationMethod(
62-
allowed_sip_ips=["10.0.0.0/8"],
62+
allowed_sip_ips=["203.0.113.0/24"],
6363
tech_prefix="9",
6464
)
6565
updated = client.voice_out_trunks().update(update).data

tests/fixtures/voice_in_trunk_groups/create.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interactions:
3232
e164\",\n \"cli_prefix\": \"+\",\n \"description\": \"\",\n\
3333
\ \"ringing_timeout\": null,\n \"configuration\": {\n \
3434
\ \"type\": \"sip_configurations\",\n \"attributes\": {\n \
35-
\ \"username\": \"{CALL_DID}\",\n \"host\": \"127.0.0.1\"\
35+
\ \"username\": \"{CALL_DID}\",\n \"host\": \"203.0.113.1\"\
3636
,\n \"port\": null,\n \"codec_ids\": [\n \
3737
\ 9,\n 8,\n 6\n ],\n \"\
3838
rx_dtmf_format_id\": 1,\n \"tx_dtmf_format_id\": 1,\n \

tests/fixtures/voice_in_trunks/create_sip_with_rerouting.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"type":"voice_in_trunks","attributes":{"configuration":{"type":"sip_configurations","attributes":{"username":"username","host":"216.58.215.110","sst_refresh_method_id":1,"port":5060,"codec_ids":[9,10,8,7,6],"rerouting_disconnect_code_ids":[56,58,59,60,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,86,87,88,89,90,91,92,96,97,98,99,101,102,103,104,105,106,107,108,1505],"media_encryption_mode":"zrtp","stir_shaken_mode":"pai","allowed_rtp_ips":["127.0.0.1"]}},"name":"hello,
3+
body: '{"data":{"type":"voice_in_trunks","attributes":{"configuration":{"type":"sip_configurations","attributes":{"username":"username","host":"203.0.113.110","sst_refresh_method_id":1,"port":5060,"codec_ids":[9,10,8,7,6],"rerouting_disconnect_code_ids":[56,58,59,60,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,86,87,88,89,90,91,92,96,97,98,99,101,102,103,104,105,106,107,108,1505],"media_encryption_mode":"zrtp","stir_shaken_mode":"pai","allowed_rtp_ips":["203.0.113.1"]}},"name":"hello,
44
test sip trunk"}}}'
55
headers:
66
Accept:
@@ -20,7 +20,7 @@ interactions:
2020
\ \"cli_prefix\": null,\n \"description\": null,\n \"ringing_timeout\"\
2121
: null,\n \"configuration\": {\n \"type\": \"sip_configurations\"\
2222
,\n \"attributes\": {\n \"username\": \"username\",\n \
23-
\ \"host\": \"216.58.215.110\",\n \"port\": 5060,\n \
23+
\ \"host\": \"203.0.113.110\",\n \"port\": 5060,\n \
2424
\ \"codec_ids\": [\n 9,\n 10,\n 8,\n \
2525
\ 7,\n 6\n ],\n \"rx_dtmf_format_id\"\
2626
: 1,\n \"tx_dtmf_format_id\": 1,\n \"resolve_ruri\": false,\n\
@@ -47,7 +47,7 @@ interactions:
4747
\ \"transport_protocol_id\": 1,\n \"max_transfers\": 0,\n\
4848
\ \"max_30x_redirects\": 0,\n \"media_encryption_mode\"\
4949
: \"zrtp\",\n \"stir_shaken_mode\": \"pai\",\n \"allowed_rtp_ips\"\
50-
: [\n \"127.0.0.1\"\n ]\n }\n },\n \"\
50+
: [\n \"203.0.113.1\"\n ]\n }\n },\n \"\
5151
created_at\": \"2018-12-28T17:37:48.010Z\"\n },\n \"relationships\"\
5252
: {\n \"voice_in_trunk_group\": {\n \"links\": {\n \"\
5353
self\": \"https://sandbox-api.didww.com/v3/voice_in_trunks/a80006b6-4183-4865-8b99-7ebbd359a762/relationships/voice_in_trunk_group\"\

tests/fixtures/voice_in_trunks/list.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interactions:
3535
\ \"cli_prefix\": \"\",\n \"description\": \"\",\n \"ringing_timeout\"\
3636
: null,\n \"configuration\": {\n \"type\": \"sip_configurations\"\
3737
,\n \"attributes\": {\n \"username\": \"username\",\n\
38-
\ \"host\": \"216.58.215.78\",\n \"port\": 8060,\n \
38+
\ \"host\": \"203.0.113.78\",\n \"port\": 8060,\n \
3939
\ \"codec_ids\": [\n 9,\n 10,\n \
4040
\ 8\n ],\n \"rx_dtmf_format_id\": 1,\n \
4141
\ \"tx_dtmf_format_id\": 1,\n \"resolve_ruri\": true,\n \

tests/fixtures/voice_in_trunks/update_sip.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interactions:
1919
,\n \"cli_prefix\": null,\n \"description\": \"just a description\"\
2020
,\n \"ringing_timeout\": null,\n \"configuration\": {\n \"\
2121
type\": \"sip_configurations\",\n \"attributes\": {\n \"username\"\
22-
: \"new-username\",\n \"host\": \"216.58.215.110\",\n \"\
22+
: \"new-username\",\n \"host\": \"203.0.113.110\",\n \"\
2323
port\": 5060,\n \"codec_ids\": [\n 9,\n 10,\n\
2424
\ 8,\n 7,\n 6\n ],\n \"\
2525
rx_dtmf_format_id\": 1,\n \"tx_dtmf_format_id\": 1,\n \"\
@@ -46,7 +46,7 @@ interactions:
4646
\ \"transport_protocol_id\": 1,\n \"max_transfers\": 5,\n\
4747
\ \"max_30x_redirects\": 0,\n \"media_encryption_mode\"\
4848
: \"zrtp\",\n \"stir_shaken_mode\": \"pai\",\n \"allowed_rtp_ips\"\
49-
: [\n \"127.0.0.1\"\n ]\n }\n },\n \"\
49+
: [\n \"203.0.113.1\"\n ]\n }\n },\n \"\
5050
created_at\": \"2018-12-28T17:37:48.010Z\"\n },\n \"relationships\"\
5151
: {\n \"voice_in_trunk_group\": {\n \"links\": {\n \"\
5252
self\": \"https://sandbox-api.didww.com/v3/voice_in_trunks/a80006b6-4183-4865-8b99-7ebbd359a762/relationships/voice_in_trunk_group\"\

tests/fixtures/voice_out_trunks/list.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interactions:
1919
"threshold_amount": "200.0", "media_encryption_mode": "srtp_sdes", "default_dst_action":
2020
"reject_all", "dst_prefixes": ["370"], "force_symmetric_rtp": true, "rtp_ping":
2121
true, "callback_url": null, "authentication_method": {"type": "credentials_and_ip",
22-
"attributes": {"allowed_sip_ips": ["10.11.12.13/32"], "tech_prefix": "", "username":
22+
"attributes": {"allowed_sip_ips": ["203.0.113.1/32"], "tech_prefix": "", "username":
2323
"dpjgwbbac9", "password": "z0hshvbcy7"}}}, "relationships": {"default_did":
2424
{"links": {"self": "https://sandbox-api.didww.com/v3/voice_out_trunks/425ce763-a3a9-49b4-af5b-ada1a65c8864/relationships/default_did",
2525
"related": "https://sandbox-api.didww.com/v3/voice_out_trunks/425ce763-a3a9-49b4-af5b-ada1a65c8864/default_did"}},

tests/fixtures/voice_out_trunks/show.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interactions:
2020
"reject_all", "dst_prefixes": ["370"], "force_symmetric_rtp": true, "rtp_ping":
2121
true, "callback_url": null, "external_reference_id": "crm-vot-0001", "emergency_enable_all":
2222
false, "rtp_timeout": 30, "authentication_method": {"type": "credentials_and_ip",
23-
"attributes": {"allowed_sip_ips": ["10.11.12.13/32"], "tech_prefix": "", "username":
23+
"attributes": {"allowed_sip_ips": ["203.0.113.1/32"], "tech_prefix": "", "username":
2424
"dpjgwbbac9", "password": "z0hshvbcy7"}}}, "relationships": {"default_did":
2525
{"links": {"self": "https://sandbox-api.didww.com/v3/voice_out_trunks/425ce763-a3a9-49b4-af5b-ada1a65c8864/relationships/default_did",
2626
"related": "https://sandbox-api.didww.com/v3/voice_out_trunks/425ce763-a3a9-49b4-af5b-ada1a65c8864/default_did"},

tests/fixtures/voice_out_trunks/update.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interactions:
1919
"threshold_amount": "200.0", "media_encryption_mode": "disabled", "default_dst_action":
2020
"reject_all", "dst_prefixes": ["370"], "force_symmetric_rtp": true, "rtp_ping":
2121
true, "callback_url": null, "authentication_method": {"type": "credentials_and_ip",
22-
"attributes": {"allowed_sip_ips": ["10.11.12.13/32"], "tech_prefix": "", "username":
22+
"attributes": {"allowed_sip_ips": ["203.0.113.1/32"], "tech_prefix": "", "username":
2323
"dpjgwbbac9", "password": "z0hshvbcy7"}}}, "relationships": {"default_did":
2424
{"links": {"self": "https://sandbox-api.didww.com/v3/voice_out_trunks/425ce763-a3a9-49b4-af5b-ada1a65c8864/relationships/default_did",
2525
"related": "https://sandbox-api.didww.com/v3/voice_out_trunks/425ce763-a3a9-49b4-af5b-ada1a65c8864/default_did"}},

tests/fixtures/voice_out_trunks/update_clear_emergency_dids.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interactions:
1212
uri: https://sandbox-api.didww.com/v3/voice_out_trunks/01234567-89ab-cdef-0123-456789abcdef
1313
response:
1414
body:
15-
string: '{"data":{"id":"01234567-89ab-cdef-0123-456789abcdef","type":"voice_out_trunks","attributes":{"name":"Trunk with emergency DIDs","on_cli_mismatch_action":"replace_cli","capacity_limit":200,"created_at":"2026-01-15T10:00:00.000Z","allow_any_did_as_cli":false,"status":"active","threshold_reached":false,"threshold_amount":"100.0","default_dst_action":"allow_all","dst_prefixes":["1"],"media_encryption_mode":"disabled","callback_url":null,"force_symmetric_rtp":false,"allowed_rtp_ips":[],"emergency_enable_all":false,"rtp_timeout":30,"authentication_method":{"type":"credentials_and_ip","attributes":{"allowed_sip_ips":["10.0.0.1/32"],"tech_prefix":"","username":"user1","password":"pass1"}}},"relationships":{"emergency_dids":{"links":{"self":"https://sandbox-api.didww.com/v3/voice_out_trunks/01234567-89ab-cdef-0123-456789abcdef/relationships/emergency_dids","related":"https://sandbox-api.didww.com/v3/voice_out_trunks/01234567-89ab-cdef-0123-456789abcdef/emergency_dids"}}}},"meta":{"api_version":"2026-04-16"}}'
15+
string: '{"data":{"id":"01234567-89ab-cdef-0123-456789abcdef","type":"voice_out_trunks","attributes":{"name":"Trunk with emergency DIDs","on_cli_mismatch_action":"replace_cli","capacity_limit":200,"created_at":"2026-01-15T10:00:00.000Z","allow_any_did_as_cli":false,"status":"active","threshold_reached":false,"threshold_amount":"100.0","default_dst_action":"allow_all","dst_prefixes":["1"],"media_encryption_mode":"disabled","callback_url":null,"force_symmetric_rtp":false,"allowed_rtp_ips":[],"emergency_enable_all":false,"rtp_timeout":30,"authentication_method":{"type":"credentials_and_ip","attributes":{"allowed_sip_ips":["203.0.113.1/32"],"tech_prefix":"","username":"user1","password":"pass1"}}},"relationships":{"emergency_dids":{"links":{"self":"https://sandbox-api.didww.com/v3/voice_out_trunks/01234567-89ab-cdef-0123-456789abcdef/relationships/emergency_dids","related":"https://sandbox-api.didww.com/v3/voice_out_trunks/01234567-89ab-cdef-0123-456789abcdef/emergency_dids"}}}},"meta":{"api_version":"2026-04-16"}}'
1616
headers:
1717
Content-Type:
1818
- application/vnd.api+json

0 commit comments

Comments
 (0)