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.
?
?
?