This is the content of the modules.conf file
[modules]
autoload=yes
;========================= FUNCTION Modules
load => func_odbc.so
;========================== PBX Modules
noload => pbx_gtkconsole.so
;=========================== RESSOURCES Modules
load => res_musiconhold.so
load => res_odbc_transaction.so
load => res_odbc.so
;=========================== CHANNELS Modules
noload => chan_alsa.so
noload => chan_console.so
noload => chan_sip.so
load => chan_pjsip.so
I add this in func_odbc.conf file
[CALLSHISTORY]
prefix=ODBC
dsn=calls-tracking-connector
writesql=INSERT INTO callshistory (date,numeroPoste,numeroDID,destinataire,sens) VALUES('${ARG1}','${ARG2}','${ARG3}','${ARG4}','${ARG5}')
In the extensions.conf
[outgoing-calls]
;========== outgoing Calls
exten => _0X.,1,NoOp(Outgoing Call from ${CALLERID(all)} to ${EXTEN})
same => n,Set(POSTE=${CHANNEL:6:3})
same => n,NoOp(SendedCID = ${CALLERID(num)})
same => n,Set(CALLERID(num)=${DB(CID/${POSTE})})
same => n,NoOp(SendedCID = ${CALLERID(num)})
same => n,Set(NOW=${STRFTIME(${EPOCH},,%Y_%m_%d_%H_%M_%S)})
same => n,System(echo "--appel_sortant --- callerid : ${CALLERID(num)} ---- ${STRFTIME(${EPOCH},,%Y_%m_%d_%H_%M_%S)} ----" >> /var/spool/asterisk/log/debug.txt)
same => n,Set(REC_FILE_NAME=OUT_${NOW}_${EXTEN}_${POSTE}.wav)
same => n,Set(TYPE=OUT)
same => n,Set(ODBC_CALLSHISTORY()=${NOW},${POSTE},${CALLERID(num)},${EXTEN},${TYPE})
...
In CLI Asterisk, I have any error message:
Setting global variable 'SIPDOMAIN' to '192.168.40.55'
-- Executing [00221705237773@from-internal:1] NoOp("PJSIP/103-0000003a", "Appel International from "Arnold" <103> to 00221705237773") in new stack
-- Executing [00221705237773@from-internal:2] Set("PJSIP/103-0000003a", "POSTE=103") in new stack
-- Executing [00221705237773@from-internal:3] NoOp("PJSIP/103-0000003a", "SendedCID = 103") in new stack
-- Executing [00221705237773@from-internal:4] Set("PJSIP/103-0000003a", "CALLERID(num)=028992018") in new stack
-- Executing [00221705237773@from-internal:5] NoOp("PJSIP/103-0000003a", "SendedCID = 028992018") in new stack
-- Executing [00221705237773@from-internal:6] Set("PJSIP/103-0000003a", "NOW=2018-05-29 15:15:07") in new stack
-- Executing [00221705237773@from-internal:7] System("PJSIP/103-0000003a", "echo "--appel_sortant INTERNATIONAL --- callerid : 028992018 ---- 2018-05-29 15:15:07 ----" >> /var/spool/asterisk/log/debug.txt") in new stack
-- Executing [00221705237773@from-internal:8] Set("PJSIP/103-0000003a", "REC_FILE_NAME=OUT_2018-05-29 15:15:07_00221705237773_103.wav") in new stack
-- Executing [00221705237773@from-internal:9] Set("PJSIP/103-0000003a", "TYPE=OUT") in new stack
-- Executing [00221705237773@from-internal:10] Set("PJSIP/103-0000003a", "ODBC_CALLSHISTORY()=2018-05-29 15:15:07,103,028992018,00221705237773,OUT)") in new stack
-- Executing [00221705237773@from-internal:11] Answer("PJSIP/103-0000003a", "") in new stack
-- Executing [00221705237773@from-internal:12] NoOp("PJSIP/103-0000003a", "n° Poste = 103") in new stack
-- Executing [00221705237773@from-internal:13] GotoIf("PJSIP/103-0000003a", "0?CallAllowed") in new stack
-- Executing [00221705237773@from-internal:14] GotoIf("PJSIP/103-0000003a", "0?CallAllowed") in new stack
-- Executing [00221705237773@from-internal:15] GotoIf("PJSIP/103-0000003a", "1?CallAllowed") in new stack
-- Goto (from-internal,00221705237773,21)
-- Executing [00221705237773@from-internal:21] NoOp("PJSIP/103-0000003a", "n° Poste = 103 -> Not Recorded") in new stack
-- Executing [00221705237773@from-internal:22] Set("PJSIP/103-0000003a", "PROV2USE=BelgiumVoIP") in new stack
-- Executing [00221705237773@from-internal:23] NoOp("PJSIP/103-0000003a", "Provider to use : BelgiumVoIP") in new stack
-- Executing [00221705237773@from-internal:24] GotoIf("PJSIP/103-0000003a", "0?widevoip") in new stack
-- Executing [00221705237773@from-internal:25] GotoIf("PJSIP/103-0000003a", "0?selfone") in new stack
-- Executing [00221705237773@from-internal:26] GotoIf("PJSIP/103-0000003a", "1?BelgiumVoIP") in new stack
-- Goto (from-internal,00221705237773,31)
-- Executing [00221705237773@from-internal:31] Set("PJSIP/103-0000003a", "NUM2DIAL=00221705237773") in new stack
-- Executing [00221705237773@from-internal:32] System("PJSIP/103-0000003a", "echo "--BelgiumVoIP --- callerid : 028992018 ---- 2018/05/29 15:15:07 ----" >> /var/spool/asterisk/log/debug.txt") in new stack
-- Executing [00221705237773@from-internal:33] NoOp("PJSIP/103-0000003a", "CD BelgiumVoIP") in new stack
-- Executing [00221705237773@from-internal:34] Dial("PJSIP/103-0000003a", "PJSIP/00221705237773@belgium-voip,60") in new stack
-- Called PJSIP/00221705237773@belgium-voip
-- PJSIP/belgium-voip-0000003b is ringing
== Spawn extension (from-internal, 00221705237773, 34) exited non-zero on 'PJSIP/103-0000003a'
asterisk*CLI>
But I have nothing in Database. Syntax Error in the func_odbc.conf file or in the dialplan ?