I am not sure its relevant to TangoPBX but I know we have knowledgeable freepbx and asterisk experts here so hopefully someone can help me here,
.
freepbx 17. I am using ODBC to write some data to a Database(US_CIS2QUE and table is US_Customer )
freepbx user has the grant to insert to this database.
GRANT SELECT, INSERT, UPDATE ON US_CIS2QUE.* TO freepbxuser@localhost
func_odbc.conf :
[US_ADDCUSTOMER]
dsn = US_CIS2QUE
mode = write
writehandle = US_CIS2QUE
writesql = INSERT INTOS US_Customer SET cust_no=β${ARG1}β, cust_name=β${ARG2}β, queue_no=β${ARG3}β, queue_name=β${ARG4}β, caller_id=β${ARG5}β
readsql = SELECT βOKβ
odbc.ini
[US_CISCustInfo]
Description=Connect to US CISCustInfo US_CIS2QUE
driver=MySQL
server=localhost
database=US_CIS2QUE
Port=3306
Socket=
option=3
res_odbc_custom.conf
[US_CIS2QUE]
enabled => yes
dsn => US_CISCustInfo
username=> freepbxuser
password=> xxxxxxxxxx
pooling => yes
limit => 1
pre-connect => yes
autocommit => yes
And I call it from custom dial plan :
same => n,Set(RESULT=${ODBC_US_ADDCUSTOMER(${Cust_no},${Cust_name},${Queue_no},${Queue_name},${CALLERID(num)})})
In asterisk log I see RESULT is OK but data is not added to the database.
If I add it manually I can see data and if I update func_odbc to :
writesql = INSERT INTO US_Customer SET cust_no=β100401β, cust_name=βTEST CUSTOMERβ, queue_no=β99900001β, queue_name=βTest Queueβ, caller_id='764764
Same result. I dont see it in DB. Any idea why?
And this is odbc show
ODBC DSN Settings
Name: US_CIS2QUE
DSN: US_CISCustInfo
Number of active connections: 1 (out of 1)
Logging: Disabled
Appreciate the help in advance ![]()