JSON API » calls » calls/redirect
Redirects a call. The actual redirect up is asynchronous, and may take a second or two after the function returns.
If the redirect happens on a call that's already been redirected or transferred the system may report incorrect status of the phones involved. Results vary, depending on which call leg is redirected.
Input parameters
Requires authentication and the actions or panel role privilege. User must also be an administrator, owner of a telephone line involved, or allowed to use any telephone line.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
uniqueid | String | Uniqueid of call. | Yes | |
ctype | String | Called type to redirect to. Normally empty string. | Recommended | Empty string. |
cnumber | String | Called number to redirect to. | Yes | |
channel | Integer | 1 to redirect the calling channel, 2 to redirect the called channel. | No | 1 |
Responses
Code | Description |
---|---|
204 | Redirect successfully requested. |
400 | Invalid called number specified. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
404 | The call does not exist, or you do not have permission to view it. |
Data returned
No data is returned.
Example: With required and recommended parameters
http://enswitch.example.com/api/json/calls/redirect/?auth_username=user;auth_password=password;uniqueid=1234567890.123456;ctype=;cnumber=2125551234{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
Version | Changes |
---|---|
3.15 | Privileges required changed. |
3.13 | Function added. |