使用客户CDR与cdr_adaptive_odbc的星号不起作用

时间:2017-10-12 13:19:31

标签: asterisk

我在Asterisk中遇到了一个问题14.6.1让我的自定义CDR字段使用ODBC填充到MySQL数据库,基本上我使用Dial同时进行出站呼叫,我需要在CDR中知道哪个电话实际应答了呼叫,所以我正在使用宏。

所以这是我的简单extensions.conf

exten => 12345,1,Dial(PJSIP/071XXXXXXXX@EP&PJSIP/072XXXXXXXX@EP,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})

所以这一切都运行正常,来电正在响铃,接听和宏观运行!

Asterisk的输出:

PJSIP/PrimaryEP-00000001 answered PJSIP/EP-00000000
– Executing [s@macro-test:1] Verbose(“PJSIP/EP-00000001”, “Call Answered from 12345 to 071XXXXXXXX@EP”) in new stack
Call Answered from 12345 to 071XXXXXXXX@EP
– Executing [s@macro-test:2] Set(“PJSIP/EP-00000001”, “CDR(outboundddi)= 071XXXXXXXX@EP”) in new stack
– Executing [s@macro-test:3] Set(“PJSIP/EP-00000001”, “CDR(userfield)= 071XXXXXXXX@EP”) in new stack

所以我知道这一切都有效。 Set(CDR(userfield)= $ {DIALEDPEERNUMBER})工作正常,Set(CDR(outboundddi)= $ {DIALEDPEERNUMBER})没有,它似乎被忽略了,我没有收到错误。因此,该值将填充到数据库的用户区域中,但不会在数据库的outboundddi字段中填充任何内容。

我认为它会被忽略因为cdr_odbc在后端和cdr_adaptive_odbc中注册 - 但如果我noload cdr_odbc.so然后我没有在ODBC数据库中记录任何CDR,如果我在cdr_odbc中取出配置。然后我又在ODBC数据库上得不到任何东西。

以下是一些进一步的细节:

cdr show status     呼叫详细记录(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 cdrs@asterisk.
> 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)

我想我可以忘记它并使用正常工作的用户区域,但我宁愿将其存储在自定义CDR字段中,我想知道什么是不正确的我自己的理智,所以如果有人可以把我指向我错误配置的内容我会非常感激。

由于

大卫

1 个答案:

答案 0 :(得分:0)

您已将别名行放入cdr_adaptive_odbc.conf

alias start => calldate

不,它不会扫描表本身。