Insert data in mysql database for extention.conf

I want to insert the data to my extention table[bitextensions]. The below is the database table structure for bitextensions

+----------+--------------+------+-----+---------+----------------+
| Field    | Type         | Null | Key | Default | Extra          |
+----------+--------------+------+-----+---------+----------------+
| id       | int(11)      | NO   | PRI | NULL    | auto_increment |
| context  | varchar(200) | NO   |     | NULL    |                |
| exten    | varchar(200) | NO   |     | NULL    |                |
| priority | char(50)     | NO   |     | 1       |                |
| app      | varchar(200) | NO   |     | NULL    |                |
| appdata  | varchar(200) | NO   |     | NULL    |                |
+----------+--------------+------+-----+---------+----------------+

I want to insert two rows where I can call the peer. Below is my extension.conf file

[incoming]
exten => 6001,1,Dial(SIP/6001)
exten => 6001,n,Hangup()

exten => 6002,1,Dial(SIP/6002)
exten => 6002,n,Hangup()

I want to call from 6001 to 6002. How Do I insert the data in the above table.
below is the details from extconfig.conf:

[settings]
sippeers => odbc,root,TABLENAME
extensions => odbc,root,bitextensions

Please suggest

You should be able to use a standard sql “INSERT INTO” statement. For example:

INSERT INTO <table name> (context, exten, priority) VALUES (<your context>, <your exten>, <your priority>);

I haven’t done it myself but start with INSERT INTO table_name (context, exten, priority,app,appdata) VALUES (‘incoming’,‘6002’,‘1’,‘Dial’,‘SIP/6002’),(‘incoming’,‘6002’,‘2’,‘HangUp’,’’) and see what you get.

Solved the issue. I am able to call successfully. Thanks for your reply and time.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.