You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding SIP routing functionality to PhoneNumbers SDK (Azure#22805)
* Initial commit
* Copied shared files
* Added basic functionality to the sip client.
* Copied shared folder to get the utilities. Implemented sample files. Changed naming in client
* Modified function comments and added class comment for _sip_routing_client.
* Fixed kwargs propagation
* Changed sample file to pull parameteres from environment variables.
* Changed get SIP configuration sample to be a class to align with the update samples. Changed naming of the update samples class.
* Implemented basic tests for the SIP client
* Removed unused import
* Fixed comment.
* Renamed variables dut_client to test_client.
* Merge from original repo
* Feature/communication sip configuration dev/basic client functionality (#3)
Adding async client.
* Updated from original (Azure#4)
Updated from main repo.
* Fixing pylint
* Changed value error to be compatible with python 2.
* Reverted changes for pylint.
* Fixed dev requirements and MANIFEST
* Fixing async tests. Fixing comments.
* Removed async mock to be compatible with the builds.
* Fixing test failures for Ubuntu and Mac
* Changed versions for python. Fixed pylint issue in version.
* Modified _version file to prevent path errors.
* Added newline.
* Downgraded six version to match the frozen requirements.
* Fixed async test errors by excluding asynchronous tests for python 2.7.
* Regenerated by autorest
* Updated swagger definition.
* Squashed commit of the following:
commit 3d7c16a5355a6461a4e688e89410a735dfdcfcce
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 17:50:06 2021 +0200
Added e2e and recordings of the tests.
commit 3f92f30afc5e932b2834a337401f51231abfb602
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 17:39:44 2021 +0200
Renamed communication testcase and async communication testcase.
commit 6f92a5aaf37c94878aedbfa4a505282e17041ff8
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 17:25:47 2021 +0200
Fixed sanitized url to have .net instead of .com .
commit 6e1ab5e228452b3bb29d9ec01b13a779cb6103c2
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 17:25:04 2021 +0200
Fixed async client to have all the needed asynchronous behaviour
commit a3ce07361fbab9f0fb335cd35379009486382786
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 09:23:29 2021 +0200
Split the testcase and request replacer processor into two files.
commit 26026c256bff0cd186f38656e0477f466e7e5d02
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 08:18:44 2021 +0200
Modified paths to fake credential tokens to reflect teh changed naming.
commit fdda1dd10f57b1f67a354fc844b8f5346d1ba200
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 08:17:29 2021 +0200
Added dev requirement
commit 2967dff8a91067cacdf34fb3047e5a992be1721b
Author: Jiri Burant <[email protected]>
Date: Mon Jun 7 08:17:10 2021 +0200
Renamed mocks to testcases
commit 16b55c29ba7570d00e4ed1780f60da83e852258d
Author: Jiri Burant <[email protected]>
Date: Fri Jun 4 11:38:12 2021 +0200
Renamed variable names for sip configuration
commit 63b338e3ea22e6a9c691e7a4f42663d03af5756c
Author: Jiri Burant <[email protected]>
Date: Fri Jun 4 10:45:37 2021 +0200
Renamed methods of sip routing client
commit f709b26d646df3b9b98506af22185d800c02234a
Author: Jiri Burant <[email protected]>
Date: Fri Jun 4 10:20:49 2021 +0200
Modified clients to allow for credentials.
commit ea8d1323fcfa069e066d52521a4f08f08dffe871
Author: Jiri Burant <[email protected]>
Date: Fri Jun 4 10:14:02 2021 +0200
Initial Readms
* Fixed readme links and formatting. Added sdk_moniker for client
* Refactored authentication files. AAdded response sanitization.
* Fixed linting issues.
* Modified version to beta.
* Regenerated swagger with latest definitions, implemented missing async sample files.
* Fixing lint issues.
* Fixed pylint disable comment.
* Renamed sip routing client to match the conventions and updated tests.
* Removed -Patch from public namespace.
* Addressing comments from api review
* Removed older files in separate package
* Updated version for azure.core to support newly generated code.
* Implemented swagger definition for SIP routing
* Implemented SIP routing logic
* Implemented siprouting changes
* Added new types to public package
* Changed phone numbers test to work with package structure
* prepared recordings for sip routing
* Added internal and public version of SipTrunk to accomodate for fqdn parameter. Changed public client interface to have functions separately for trunks/routes.
* Fixing formatting.
* Changed public interface.
* Recordings of e2e tests.
* Addressing comments from second internal review.
* Minor changes in cleaning up code. Added a few sample calls.
* Added test for token auth
* Implemented inputs from api review
* Fixed linting issues and credential issues.
* Fixed test recordings.
* Removed test credentials.
* Moved siprouting tests to common namespace and removed packaging on tests.
* Changed token authorization test to work in recorded mode.
Fixed dependencies in setup.py file
* Restored setup.py file to avoid package clashes.
* Regenerated code with lower version of autorest to pass build validation.
* Renamed replace_trunks and replace_routes to set_trunks, set_routes
* Renamed recordings of tests.
* Added more tests for managed identity. Updated README and Changelog.
* Updated version.
* Addressing comments from review.
* Removing forgotten credential.
* Addressing comments from review
This SDK provides functionality to easily manage `direct offer` and `direct routing` numbers.
24
+
25
+
The `direct offer` numbers come in two types: Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
26
+
They are managed using the `PhoneNumbersClient`
27
+
28
+
The `direct routing` feature enables connecting your existing telephony infrastructure to ACS.
29
+
The configuration is managed using the `SipRoutingClient`, which provides methods for setting up SIP trunks and voice routing rules, in order to properly handle calls for your telephony subnet.
30
+
31
+
### Initializing Client
32
+
Client can be initialized using the AAD authentication.
33
+
24
34
```python
25
-
# You can find your connection string from your resource in the Azure Portal
26
35
import os
27
36
from azure.communication.phonenumbers import PhoneNumbersClient
Phone numbers come in two types; Geographic and Toll-Free. Geographic phone numbers are phone numbers associated with a location, whose area codes are associated with the area code of a geographic location. Toll-Free phone numbers are phone numbers with no associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.
51
81
52
-
### Searching and Purchasing and Releasing numbers
82
+
####Searching and Purchasing and Releasing numbers
53
83
54
84
Phone numbers can be searched through the search creation API by providing an area code, quantity of phone numbers, application type, phone number type, and capabilities. The provided quantity of phone numbers will be reserved for ten minutes and can be purchased within this time. If the search is not purchased, the phone numbers will become available to others after ten minutes. If the search is purchased, then the phone numbers are acquired for the Azure resources.
55
85
56
86
Phone numbers can also be released using the release API.
57
87
88
+
### SIP routing client
89
+
90
+
Direct routing feature allows connecting customer-provided telephony infrastructure to Azure Communication Resources. In order to setup routing configuration properly, customer needs to supply the SIP trunk configuration and SIP routing rules for calls. SIP routing client provides the necessary interface for setting this configuration.
91
+
92
+
When the call arrives, system tries to match the destination number with regex number patterns of defined routes. The first route to match the number will be selected. The order of regex matching is the same as the order of routes in configuration, therefore the order of routes matters.
93
+
Once a route is matched, the call is routed to the first trunk in the route's trunks list. If the trunk is not available, next trunk in the list is selected.
94
+
58
95
## Examples
59
96
60
-
### Get All Purchased Phone Numbers
97
+
### PhoneNumbersClient
98
+
99
+
#### Get All Purchased Phone Numbers
61
100
62
101
Lists all of your purchased phone numbers
63
102
@@ -67,7 +106,7 @@ for acquired_phone_number in purchased_phone_numbers:
67
106
print(acquired_phone_number.phone_number)
68
107
```
69
108
70
-
### Get Purchased Phone Number
109
+
####Get Purchased Phone Number
71
110
72
111
Gets the information from the specified phone number
73
112
@@ -77,11 +116,11 @@ print(result.country_code)
77
116
print(result.phone_number)
78
117
```
79
118
80
-
## Long Running Operations
119
+
###Long Running Operations
81
120
82
121
The Phone Number Client supports a variety of long running operations that allow indefinite polling time to the functions listed down below.
83
122
84
-
### Search for Available Phone Number
123
+
####Search for Available Phone Number
85
124
86
125
You can search for available phone numbers by providing the capabilities of the phone you want to acquire, the phone number type, the assignment type, and the country code. It's worth mentioning that for the toll-free phone number type, proving the area code is optional.
87
126
The result of the search can then be used to purchase the number in the corresponding API.
The result of your search can be used to purchase the specified phone numbers. This can be done by passing the `search_id` from the search response to the purchase phone number API.
0 commit comments