Clients
Clients
A Client represents a user agent that can make and receive calls as well as send and receive text messages using the Restcomm Cloud. This means that you can configure any software or hardware VoIP phone with the Client Username and Password in order to register with Restcomm Cloud. Once you do that you will be able to do things like:
-
Call or text any Restcomm Number to trigger the associated Voice or SMS Application. Notice that you first need to setup the Application with the logic you want and associate it with a Restcomm Number. For more information please check here.
-
Call out to any PSTN number
-
Send SMS to any mobile number
-
Call or text any other registered Client
The Client can also be associated with a Restcomm Application, either in the form of Visual Designer Application or externally hosted. If that is the case then this application will be called no matter what digits the user of the VoIP phone dials
Client Resource URI
/2012-04-24/Accounts/{AccountSid}/Clients/{ClientSid}
-
Using SIP User Agents. When using Restcomm to handle SIP user agent you have to create a new Client resource, this resource acts as an account for your user agent and also dictates how calls made by the user agent should be handled.
-
Client without VoiceUrl Restcomm has a new implied behavior when VoiceUrl is not provided for a Client account. Restcomm will proxy calls from such Clients to the destination Client (only if registered) or to the destination Application DID.
Only registered Clients are allowed to use the B2BUA/P2P/Proxy functionalities of Restcomm. Proxying and P2P calls are only allowed between registered(authenticated) Clients.
The CDR records generated for calls made by Clients, will have account SID the account that the Client belongs to.
Clients Attributes
Attribute | Description |
---|---|
Sid |
A string that uniquely identifies this client. |
DateCreated |
The date that this client was created. |
DateUpdated |
The date that this clientr was last updated. |
FriendlyName |
A friendly name for this client. |
AccountSid |
The unique id of the Account that owns this client. |
ApiVersion |
Calls to this client will create a new RCML session with this API version. |
Login |
The name that is used inside the <Client> noun. This is also used by the user agent as the user name used for registration and outbound dialing. This must conform to "userinfo" part as defined in RFC2396. |
Password |
The password used by the user agent during registration and outbound dialing. |
Status |
The client status the possible values are 0 for disabled and 1 for enabled. |
VoiceUrl |
The URL Restcomm will request when this client makes an outbound call. |
VoiceMethod |
The HTTP method Restcomm will use when requesting the above Url. Either GET or POST. |
VoiceFallbackUrl |
The URL that Restcomm will request if execution of VoiceUrl fails for any reason. |
VoiceFallbackMethod |
The HTTP method Restcomm will use when requesting the VoiceFallbackUrl. Either GET or POST. |
VoiceApplicationSid |
If this entry contains an Sid to a voice application then Restcomm will ignore these voice URLs and use the voice URLs specified by the voice application. |
Uri |
The URI for this Client, relative to \https://$DOMAIN/api/2012-04-24/. |
Supported Operations
HTTP GET. Returns the representation of an Client resource, including the properties above.
HTTP POST/PUT. Modifies a Client resource and returns the representation, including the properties above. Below you will find a list of optional parameters.
Request Parameters
Parameter | Description |
---|---|
FriendlyName |
A formatted version of this client. |
Password |
The password used by the user agent during registration and outbound dialing. |
Status |
The client status the possible values are 0 for disabled and 1 for enabled. |
VoiceUrl |
The URL Restcomm will request when this client receives a call. |
VoiceMethod |
The HTTP method Restcomm will use when requesting the above Url. Either GET or POST. |
VoiceFallbackUrl |
The URL that Restcomm will request if execution of VoiceUrl fails for any reason. |
VoiceFallbackMethod |
The HTTP method Restcomm will use when requesting the VoiceFallbackUrl. Either GET or POST. |
VoiceApplicationSid |
If this entry contains an Sid to a voice application then Restcomm will ignore these voice URLs and use the voice URLs specified by the voice application. |
HTTP DELETE. Deletes a Client from the user’s Account.
Client List Resource
Supported Operations
HTTP GET. Returns the list representation of all the Client resources for this Account, including the properties above.
HTTP POST. Creates a new Client and returns the representation of the resource, including the properties above. Below you will find a list of required and optional parameters.
Request Parameters
Parameter | Description |
---|---|
FriendlyName |
A formatted version of this client. |
Login |
The name that is used inside the <Client> noun.This is also used by the user agent as the username used for registration and outbound dialing. |
Password |
The password used by the user agent during registration and outbound dialing. |
Status |
The client status the possible values are 0 for disabled and 1 for enabled. |
VoiceUrl |
The URL Restcomm will request when this client makes an outbound call. |
VoiceMethod |
The HTTP method Restcomm will use when requesting the above Url.Either GET or POST. |
VoiceFallbackUrl |
The URL that Restcomm will request if execution of VoiceUrl fails for any reason. |
VoiceFallbackMethod |
The HTTP method Restcomm will use when requesting the VoiceFallbackUrl.Either GET or POST. |
VoiceApplicationSid |
If this entry contains an Sid to a voice application then Restcomm will ignore these voice URLs and use the voice URLs specified by the voice application. |
Create a Client
The client name will be Alice as shown below
curl -X POST https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Clients.json \
-d 'Login=alice' \
-d 'Password=test' \
-u 'YourAccountSid:YourAuthToken'
The output of the command will be similar to the one below
{ "sid": "CL4e10e3b56a614414bcc1eeca5d96effe", "date_created": "2013-10-16T08:51:32.460-06:00", "date_updated": "2013-10-16T08:51:32.460-06:00", "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "api_version": "2012-04-24", "friendly_name": "alice", "login": "alice", "password": "test", "status": "1", "voice_method": "POST", "voice_fallback_method": "POST", "uri": "/api/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Clients/CL4e10e3b56a614414bcc1eeca5d96effe.json"
Delete a Client
You must use the Client SID
curl -X DELETE https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Clients/CLIENT_SID \
-u 'YourAccountSid:YourAuthToken'
Change Client’s Password
You must use the Client SID as shown below:
curl -X PUT https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Clients/CLIENT_SID \
-d 'Password=NewPassword' \
-u 'YourAccountSid:YourAuthToken'
Get List of available Clients
The command below shows all Clients created using the default Admin Account
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Clients.json \
-u 'YourAccountSid:YourAuthToken'
JSON GET Response
[ { "sid": "CL3003328d0de04ba68f38de85b732ed56", "date_created": "Mon, 4 Nov 2013 16:33:39 -0500", "date_updated": "Mon, 4 Nov 2013 16:33:39 -0500", "account_sid": "ACae6e420f425248d6a26948c17a9e2acf", "api_version": "2012-04-24", "friendly_name": "bob", "login": "bob", "password": "i-1c8468a2", "status": "1", "voice_method": "POST", "voice_fallback_method": "POST", "uri": "/api/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Clients/CL3003328d0de04ba68f38de85b732ed56.json" }, { "sid": "CLa2b99142e111427fbb489c3de357f60a", "date_created": "Mon, 4 Nov 2013 12:52:44 -0500", "date_updated": "Mon, 4 Nov 2013 12:52:44 -0500", "account_sid": "ACae6e420f425248d6a26948c17a9e2acf", "api_version": "2012-04-24", "friendly_name": "alice", "login": "alice", "password": "i-1c8468a2", "status": "1", "voice_method": "POST", "voice_fallback_method": "POST", "uri": "/api/2012-04-24/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Clients/CLa2b99142e111427fbb489c3de357f60a.json" } ]
Distributed Request Processing
The CPaaS platform has a distributed microservice architecture, that enables linear scalability during traffic growth and handles a high volume of REST API requests, voice calls, and SMS messages. Each architecture component handles different types of requests.
When you modify the provisioning data via the Management REST APIs, up to few minutes are needed for the update to reflect the changes in all call processing units that handle calls and SMS. Provisioning data modifications are done using the HTTP POST, PUT and DELETE methods. The POST method updates records immediately with no delay during the operation.
Distributed request processing is available for the following Management APIs, as well as the CPaaS Console.