HomeVICIdial TutorialsVICIdial Non Agent API TutorialsModifying or Deleting Phone Aliases Using update_phone_alias API in VICIdial

Modifying or Deleting Phone Aliases Using update_phone_alias API in VICIdial

Managing phone aliases in VICIdial is crucial for call routing, agent login flexibility, and VoIP system efficiency. The update_phone_alias API allows administrators to modify existing phone alias records or delete them dynamically, ensuring that the call center environment remains organized, scalable, and up-to-date.

Instead of manually adjusting alias settings through the VICIdial Admin Panel, this API enables real-time updates, bulk alias modifications, and integration with external VoIP/PBX systems, enhancing operational efficiency.

What is a Phone Alias in VICIdial?

A phone alias is an alternate identifier that is mapped to a phone extension, enabling:
Multiple logins for agents using a single phone device
Redundant phone configurations for failover handling
Dynamic call routing for specific agents or departments
Tracking and analytics for calls made using different aliases

Why Use the update_phone_alias API?

Modify existing phone aliases dynamically
Delete outdated or inactive aliases in real time
Ensure seamless call routing and VoIP alias management
Integrate with external telephony and CRM systems
Maintain an organized alias structure for large call centers

In this tutorial, we’ll cover:
🔹 How the update_phone_alias API works
🔹 How to configure and authenticate API access
🔹 How to construct and send API requests
🔹 Examples using a browser, cURL, and Postman
🔹 How to interpret API responses and troubleshoot errors
🔹 Best practices for using the update_phone_alias API efficiently

Let’s get started! 🚀


Understanding the update_phone_alias API Function

The update_phone_alias API allows administrators to modify an existing phone alias record or delete a phone alias from VICIdial.

What Information Can Be Updated Using update_phone_alias API?

Alias Name – Modify the alias name
Extension – Change the mapped phone extension
Protocol Type – Update the alias protocol (SIP or IAX2)
Active Status – Enable (Y) or disable (N) an alias
Delete Alias – Remove the alias from VICIdial

Common Use Cases for update_phone_alias API

🔹 Renaming aliases for better call tracking and reporting
🔹 Updating phone alias configurations for new agents
🔹 Disabling or deleting unused aliases to clean up records
🔹 Managing alias assignments dynamically via API integration
🔹 Optimizing call routing based on updated agent roles


Step 1: Prerequisites for Using the API

Before using the update_phone_alias API, ensure you have:

VICIdial installed and configured
An API-enabled user account with administrative permissions**
A valid alias name that exists in VICIdial for modification
VICIdial server access credentials

How to Enable API Access in VICIdial

1️⃣ Log in to the VICIdial Admin Panel
2️⃣ Navigate to Admin > Users
3️⃣ Select the user who will access the API
4️⃣ Set API Access to 1 (Enabled)
5️⃣ Set User Level to 8 or higher** (Admin-level access) 6️⃣ Add update_phone_aliasto the **Allowed API Functions** (or set toALL`)
7️⃣ Click Save Changes

Now, your user is authorized to modify or delete phone aliases dynamically using the API.


Step 2: Constructing the API Request

The VICIdial API uses HTTP GET requests, meaning you can access it via a browser, cURL, or API tools like Postman.

Base API URL

arduino
http://your-vicidial-server/vicidial/non_agent_api.php

🔹 Replace your-vicidial-server with your actual VICIdial instance.

Required Parameters for update_phone_alias API

Parameter Description Example
function Specifies the API function (update_phone_alias) update_phone_alias
user VICIdial API username admin
pass VICIdial API password 1234
source Identifier for tracking API calls PhoneAliasUpdate
alias The alias to modify SupportDesk
new_alias (Optional) Change alias name TechSupport
extension (Optional) Update the mapped phone extension 1002
protocol (Optional) Change the protocol (SIP or IAX2) SIP
active (Optional) Enable (Y) or disable (N) the alias Y
delete_alias (Optional) Delete the alias (Y to delete) N

Step 3: Sending the API Request

Method 1: Updating a Phone Alias via a Web Browser

Simply enter the following URL in your browser (replace credentials accordingly):

pgsql
http://your-vicidial-server/vicidial/non_agent_api.php?function=update_phone_alias&user=admin&pass=1234&source=PhoneAliasUpdate&alias=SupportDesk&new_alias=TechSupport&extension=1002&protocol=SIP&active=Y

🔹 Press Enter, and the API should modify the alias settings.


Method 2: Updating a Phone Alias via cURL (Command Line)

For developers, cURL is a convenient tool for making API requests. Use the following command:

bash
curl -X GET "http://your-vicidial-server/vicidial/non_agent_api.php?function=update_phone_alias&user=admin&pass=1234&source=PhoneAliasUpdate&alias=SupportDesk&new_alias=TechSupport&extension=1002&protocol=SIP&active=Y"

🔹 This will return a confirmation message indicating the alias has been updated.


Method 3: Deleting a Phone Alias via Postman

1️⃣ Open Postman
2️⃣ Set the request type to GET
3️⃣ Enter the API URL with delete_alias=Y
4️⃣ Click Send
5️⃣ The response should confirm that the alias was removed


Step 4: Understanding API Responses

If the request is successful, VICIdial returns a response confirming the alias update or deletion:

vbnet
SUCCESS: TechSupport | Alias Updated Successfully for Extension 1002

OR

vbnet
SUCCESS: SupportDesk | Alias Deleted Successfully

Breaking Down the Response

Response Value Meaning
SUCCESS The request was processed successfully
TechSupport The updated alias name
Alias Updated Successfully for Extension 1002 Confirmation message

Step 5: Handling Errors & Troubleshooting

Error Message Cause Solution
ERROR: USER DOES NOT HAVE PERMISSION TO USE THIS FUNCTION Insufficient API permissions Ensure user level is 8+ and API Access is enabled
ERROR: INVALID USERNAME OR PASSWORD Wrong credentials Verify API username and password
ERROR: ALIAS NOT FOUND The specified alias does not exist Ensure alias is correct
ERROR: NO FUNCTION SPECIFIED Missing function parameter Ensure function=update_phone_alias is included

Conclusion

The update_phone_alias API function is an essential tool for modifying and deleting phone aliases dynamically in VICIdial. Whether you’re renaming aliases, updating extensions, disabling inactive aliases, or cleaning up records, this API provides a fast and efficient way to manage your call center infrastructure.

Feel free to contact us or simply start a live chat to get connected to one of our team members. Here is our contact information.

Calling from US: +1 954-990-0053
Email: office@callix.ai

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Special Offerspot_img

Must Read

spot_img
spot_img
spot_img

Related Articles - Must Read

spot_img