How to get the extension number of all users stored in MYSQL in Asterisk-mysql tutorial

Source: Internet
Author: User
Tags mysql tutorial
How do I get the extension numbers of all users stored in MYSQL in Asterisk and the extension numbers of all users stored in MYSQL in Asterisk? Recently, in this scenario, you need to obtain the extension numbers of all users stored in MYSQL in Asterisk in the call system, because the phone numbers obtained from other channels may be inaccurate. the specific application scenarios are as follows:

How do I get the extension numbers of all users stored in MYSQL in Asterisk and the extension numbers of all users stored in MYSQL in Asterisk? Recently, in this scenario, you need to obtain the extension numbers of all users stored in MYSQL in Asterisk in the call system, because the phone numbers obtained from other channels may be inaccurate. the specific application scenarios are as follows:

How to obtain the extension numbers of all users stored in MYSQL in Asterisk

How to obtain the extension numbers of all users stored in MYSQL in Asterisk

?

Recently, in this scenario, you need to obtain the extension numbers of all users stored in MYSQL in Asterisk in the call system, because the phone numbers obtained from other channels may be inaccurate. the specific application scenario is: after the user finds the employee he wants to contact, the system uses the employee name to find the phone number corresponding to the employee on the Asterisk server, connect the current phone number with the phone number of the employee you are looking.

?

1. find the *** on the Asterisk server ***. conf configuration file, which is called res_odbc_additional.conf. because this file was not recorded at the time, I cannot remember the name. you can find it by yourself. it has the following configuration.

hostname = 10.17.64.10dbname=asteriskcdrdb password = AbQdmjiuo8D1user = freepbxuseruserfield=1port=3306 sock=/tmp/mysql.sock

2. use the above configuration information to connect to the MYSQL client. If an error occurs: error code: 1130 Host 'XXX' is not allowed to connect to this MySQL server ,? Please refer to another article: http://jerval.iteye.com/admin/blogs/2101747 to solve.

3. after the connection is successful, the following two databases are displayed.

asteriskasteriskcdrdb

? The asterisk is the core configuration information of the Asterisk. asteriskcdrdb is used to record call records. here we open the asterisk database, find the devices table, and open the table to see all users' extension numbers. the table structure is as follows:

FieldTypeNullKeyDefaultExtraidvarchar(20)NOtechvarchar(10)NOdialvarchar(50)NOdevicetypevarchar(5)NOuservarchar(50)YESNULLdescriptionvarchar(50)YESNULLemergency_cidvarchar(100)YESNULL

? So far, you can access this information through JDBC or other data access code.

?

?

?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.