英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论