我有Asterisk的14.6.1的一個問題讓使用ODBC MySQL數據庫填充我的自定義字段的CDR,基本上我是用撥號同時進行外呼,我需要知道手機實際接聽電話的CDR,所以我正在使用宏。Asterisk的使用客戶的CDR與cdr_adaptive_odbc不工作
因此,這裏是我的簡單的extensions.conf
exten => 12345,1,Dial(PJSIP/[email protected]&PJSIP/[email protected],180,M(test),r)
我的宏:
[macro-test]
exten => s,1,Verbose(Call Answered from ${CALLERID(num)} to ${DIALEDPEERNUMBER})
exten => s,2,Set(CDR(outboundddi)=${DIALEDPEERNUMBER})
exten => s,3,Set(CDR(userfield)=${DIALEDPEERNUMBER})
所以這一切工作正常,電話振鈴,被回答和宏觀運行!從星號
輸出:
PJSIP/PrimaryEP-00000001 answered PJSIP/EP-00000000
– Executing [[email protected]:1] Verbose(「PJSIP/EP-00000001」, 「Call Answered from 12345 to [email protected]」) in new stack
Call Answered from 12345 to [email protected]
– Executing [[email protected]:2] Set(「PJSIP/EP-00000001」, 「CDR(outboundddi)= [email protected]」) in new stack
– Executing [[email protected]:3] Set(「PJSIP/EP-00000001」, 「CDR(userfield)= [email protected]」) in new stack
所以我知道這一切工作。 Set(CDR(userfield)= $ {DIALEDPEERNUMBER})工作正常,Set(CDR(outboundddi)= $ {DIALEDPEERNUMBER})沒有,它似乎被忽略,並且我沒有收到錯誤。因此,該值將填充到數據庫的用戶字段中,但沒有填充到數據庫的outboundddi字段中。
我認爲它會被忽略,因爲cdr_odbc是在後端以及cdr_adaptive_odbc中註冊的 - 但是如果我無法加載cdr_odbc.so,那麼我沒有在ODBC數據庫中記錄任何CDR,並且如果我在cdr_odbc中取出配置.conf然後我再次在ODBC數據庫上沒有得到。
下面是一些進一步的細節:
CDR顯示狀態 呼叫詳細記錄(CDR)設置
Logging: Enabled
Mode: Simple
Log unanswered calls: Yes
Log congestion: Yes
Registered Backends
cdr-custom
cdr_manager (suspended)
radius
Adaptive ODBC
ODBC
res_config_sqlite
ODBC顯示 ODBC DSN設置
Name: asterisk
DSN: Asterisk
Number of active connections: 1 (out of 1)
模塊重裝cdr_adaptive_odbc.so
Module ‘cdr_adaptive_odbc.so’ reloaded successfully.
– Reloading module ‘cdr_adaptive_odbc.so’ (Adaptive ODBC CDR backend)
== Parsing ‘/etc/asterisk/cdr_adaptive_odbc.conf’: Found
– Found adaptive CDR table [email protected]
> Found calldate column with type 93 with len 19, octetlen 19, and numlen (0,10)
> Found clid column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found src column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found dst column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found dcontext column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found channel column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found dstchannel column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found lastapp column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found lastdata column with type 12 with len 80, octetlen 80, and numlen (0,0)
> Found duration column with type 4 with len 10, octetlen 10, and numlen (0,10)
> Found billsec column with type 4 with len 10, octetlen 10, and numlen (0,10)
> Found disposition column with type 12 with len 45, octetlen 45, and numlen (0,0)
> Found amaflags column with type 4 with len 10, octetlen 10, and numlen (0,10)
> Found accountcode column with type 12 with len 20, octetlen 20, and numlen (0,0)
> Found userfield column with type 12 with len 255, octetlen 255, and numlen (0,0)
> Found uniqueid column with type 12 with len 32, octetlen 32, and numlen (0,0)
> Found linkedid column with type 12 with len 32, octetlen 32, and numlen (0,0)
> Found sequence column with type 12 with len 32, octetlen 32, and numlen (0,0)
> Found peeraccount column with type 12 with len 32, octetlen 32, and numlen (0,0)
> Found outboundddi column with type 12 with len 50, octetlen 50, and numlen (0,0)
cdr_adaptive_cdr.conf
[adaptive_connection]
connection=asterisk
table=cdrs
usegmtime=yes
cdr_odbc.conf
[global]
dsn=asterisk
loguniqueid=yes
dispositionstring=yes
table=cdrs ;「cdr」 is default table name
usegmtime=yes ; set to 「yes」 to log in GMT
hrtime=yes ;Enables microsecond accuracy with the billsec and duration fields
newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence)
我想我可以忘掉它,並用正在工作的userfield,但我寧願它被保存在一個自定義CDR領域,我想知道什麼是不正確的,因爲我自己的理智,所以如果任何人都可以指出我的錯誤配置,我將非常感激。
感謝
大衛