如何向通话的CEL记录中添加自定义信息?

huangapple go评论53阅读模式
英文:

How to add custom information to CEL records for a call?

问题

使用CDR,添加自定义字段很容易。

[exit]
exten = s,1,NoOp()
same => n,Set(CDR(my_custom_field)=${SOME_VARIABLE})
same => n,Dial(PJSIP/phone1&DAHDI/17,30,tTkK)
same => n,Hangup()

我只需要将my_custom_field作为cdr表的一列添加,它将被填充。

我想用CEL来复制这个操作,但是修改表并设置CHANNEL(my_custom_field)项目不起作用,该列始终为NULL。我可以使用以下方法:

same => n,Set(CHANNEL(userfield)=${SOME_VARIABLE})

但我想使用自定义字段名。

英文:

With a CDR, is easy to add a custom field.

[exit]
exten = s,1,NoOp()
same => n,Set(CDR(my_custom_field)=${SOME_VARIABLE})
same => n,Dial(PJSIP/phone1&DAHDI/17,30,tTkK)
same => n,Hangup()

All I have to do is add my_custom_field as a column to the cdr table and it will be populated.

I want to replicate this with CEL, but altering the table and setting the CHANNEL(my_custom_field) item doesn't work, the column is always NULL. I can use this:

same => n,Set(CHANNEL(userfield)=${SOME_VARIABLE})

But I want to use a custom field name.

答案1

得分: 2

可以添加自定义CEL事件,但不能添加列。你可以添加事件(新行)。

CELGenUserEvent(event-name, [extra])

"Extra" 可以是你想要的任何文本。

更多信息请参考:https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_CELGenUserEvent

之后,你可以解析你的CEL表格并更新任何你想要更新的字段。

英文:

Yes, you can add custom CEL event. But you can't add column. You can add event(new row)

CELGenUserEvent(event-name,[extra])

Extra can be any text you want.

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_CELGenUserEvent

After that you can parse your CEL table and update any field you want to update.

huangapple
  • 本文由 发表于 2023年2月26日 23:07:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75572887.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定