Asterisk 具有新功能
我在 sql 表中创建了一个 write func odbc 列表记录文件:
[R]
dsn=connector
write=INSERT INTO ast_records (filename,caller,callee,dtime) VALUES
('${ARG1}','${ARG2}','${ARG3}','${ARG4}')
prefix=M
并将其设置在 dialplan 中:
exten => _0X.,n,Set(
M_R(${MIXMONITOR_FILENAME}\,${CUSER}\,${EXTEN}\,${DTIME})= )
当我执行它时,我收到错误:ast_func_write: M_R 函数未注册:
请注意:带有 windows
I created a write func odbc list records files in sql table:
[R]
dsn=connector
write=INSERT INTO ast_records (filename,caller,callee,dtime) VALUES
('${ARG1}','${ARG2}','${ARG3}','${ARG4}')
prefix=M
and set it in dialplan :
exten => _0X.,n,Set(
M_R(${MIXMONITOR_FILENAME}\,${CUSER}\,${EXTEN}\,${DTIME})= )
when I excute it I get an error : ast_func_write: M_R Function not registered:
note that : asterisk with windows
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我看到的第一件事是您错误地执行了对函数的调用...您需要分配值,而不是参数...尝试这个:
func_odbc.conf:
<前><代码>[R]
dsn=连接器
前缀=M
writesql=INSERT INTO ast_records (文件名,调用者,被调用者,dtime) VALUES('${VAL1}','${VAL2}','${VAL3}','${VAL4}');
拨号方案:
如果这对您没有帮助,请继续我的列表:)
确保 func_odbc.so 正在由 Asterisk 加载。 (来自 asterisk CLI:模块显示类似 func_odbc)...如果未加载,则无法“构建”您的自定义 odbc 查询函数。
关于 reluze 的答案...不是在这里叫您出来,但在这里使用 PHP AGI 是严重的矫枉过正。 func_odbc 函数工作得很好,为什么通过调用外部脚本(必须在 TOP 本身上使用解释程序)来产生更多开销和潜在的安全问题?
First thing I saw was you were performing the call to the function incorrectly...you need to be assigning values, not arguments....try this:
func_odbc.conf:
dialplan:
If that doesn't help you, continue on in my list :)
Make sure func_odbc.so is being loaded by Asterisk. (from the asterisk CLI: module show like func_odbc)... If it's not loaded, it can't "build" your custom odbc query function.
Regarding the answer from recluze...Not to call you out here, but using a PHP AGI is serious overkill here. The func_odbc function works just fine, why create more overhead and potential security issues by calling an external script (which has to use a interpreter program on TOP itself)?
您应该将 func odbc 函数称为“ODBC_connector”。连接器应在 func_odbc.conf 文件 [连接器] 中使用。在拨号方案中应该这样调用。
you should call func odbc function as "ODBC_connector". connector should be use in the func_odbc.conf file [connector]. In the dialplan it should call like this.
我不太明白你想要使用的语法,但是如何使用 AGI(带有 php)来实现这一点。只需在 php 脚本中定义逻辑并从拨号计划中调用它,如下所示:
I don't really understand the syntax you're trying to use but how about using AGI (with php) for this. Just define your logic in a php script and call it from your dialplan as: