Asterisk将客户cdr与cdr\u adaptive\u odbc一起使用不起作用

Asterisk将客户cdr与cdr\u adaptive\u odbc一起使用不起作用,asterisk,Asterisk,我在Asterisk 14.6.1中遇到了一个问题,使用ODBC将我的自定义CDR字段填充到MySQL数据库,基本上我使用拨号同时拨打出站电话,我需要在CDR中知道哪个电话实际接听了电话,所以我使用了宏 下面是我的简单extensions.conf exten => 12345,1,Dial(PJSIP/071XXXXXXXX@EP&PJSIP/072XXXXXXXX@EP,180,M(test),r) 和我的宏: [macro-test] exten => s,1,Ver

我在Asterisk 14.6.1中遇到了一个问题,使用ODBC将我的自定义CDR字段填充到MySQL数据库,基本上我使用拨号同时拨打出站电话,我需要在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})
因此,所有这些都可以正常工作,来电铃声响起,接听,宏运行

星号的输出:

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
所以我知道这一切都是有效的。集合(CDR(userfield)=${dialledpeernumber})工作正常,集合(CDR(outboundddi)=${dialledpeernumber})没有,它似乎被忽略,我没有收到错误。因此,在数据库的userfield中填充该值,但在数据库的outboundddi字段中没有填充任何内容

我认为它会被忽略,因为cdr_odbc和cdr_adaptive_odbc都在后端注册-但是如果我卸载cdr_odbc.so,那么我不会在odbc数据库中记录任何cdr,如果我在cdr_odbc.conf中取出配置,那么我在odbc数据库中也不会得到任何内容

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

cdr显示状态 呼叫详细记录(CDR)设置

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\u自适应\u 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)
alias start => calldate
我想我可以忘记它,使用正在工作的userfield,但我更希望它存储在一个自定义CDR字段中,我想知道什么对我自己的理智是不正确的,所以如果有人能指出我配置不正确的地方,我将不胜感激

谢谢


David

您已经在cdr\u adaptive\u 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)
alias start => calldate

不,它不会扫描表本身。

您已经在cdr\u adaptive\u 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)
alias start => calldate
不,它不会扫描表本身