Running Asterisk 13 on Fedora 21 Server. SELinux = Permissive.
I have configured asterisk to write CDRs to MySQL. I get all the normal fields written to the CDR.
I also have this in the dial plan (extensions.conf):
exten => h,n,Set(CDR(cause_code)=${HANGUPCAUSE})
exten => h,n,Set(CDR(cause_name)= ${ODBC_GET_CAUSE(${HANGUPCAUSE})})
exten => h,n,Set(TrNumber=${ODBC_GET_DIALED_NUMBER(${CDR(lastdata)})})
exten => h,n(writeTranslate),SET(CDR(TranslatedNumber)=${TrNumber})
Note the custom fields cause_code, cause_name, and TranslatedNumber/
The fields cause_code, cause_name, and TranslatedNumber exist in the cdr table.
When the code runs I get this:
-- Executing [h@context-out:5] Set("SIP/xx.xxx.xx.xx-00000004", "CDR(cause_code)=16") in new stack
-- Executing [h@context-out:6] Set("SIP/xx.xxx.xx.xx-00000004", "CDR(cause_name)= normal call clearing") in new stack
-- Executing [h@context-out:7] Set("SIP/xx.xxx.xx.xx-00000004", "TrNumber=15555552233") in new stack
-- Executing [h@context-out:9] Set("SIP/xx.xxx.xx.xx-00000004", "CDR(translatedNumber)=15555552233") in new stack
This is in verbose mode. Note that the code Setting the CDR runs without error and with data to be posted to the CDR.
cdr_adaptive_odbc.conf looks like this:
[adaptive-connection]
connection=asterisk
table=cdr
alias start => calldate
usegmtime=yes
That is all I should need. The cdr_adaptive_odbc module has been reloaded as has been the dial plan.
YET, these fields are shown as NULL in the cdr table. Suggestions?