通过AMI和PHP使用模板附加类别

通过AMI和PHP使用模板附加类别,php,asterisk,asteriskami,Php,Asterisk,Asteriskami,我正在使用PHP库更新asterisk的配置文件 我添加了如下用户: $a->write('Action: updateconfig\r\nReload: yes\r\nSrcfilename: users.conf\r\nDstfilename: users.conf\r\nAction-000000: NewCat\r\nCat-000000:test\r\nAction-000001: append\r\nCat-000001: test\r\nVar-000001: mailbox

我正在使用PHP库更新asterisk的配置文件

我添加了如下用户:

$a->write('Action: updateconfig\r\nReload: yes\r\nSrcfilename: users.conf\r\nDstfilename: users.conf\r\nAction-000000: NewCat\r\nCat-000000:test\r\nAction-000001: append\r\nCat-000001: test\r\nVar-000001: mailbox\r\nValue-000001: test\r\n ...etc user fields');
但我还有一个模板
templatename
,所以我想用模板添加类别。我发现了这一点,即您只需将类别名称更改为
test[(templatename)]
。但这并不能创造任何东西


如果您需要,我可以发布库,但它只是带有套接字的自定义库。

如果您发送类似的内容,应该使用引号字符串

如果你不是大师,强烈建议不要使用users.conf

原因:它可能导致不符合预期/不安全的部分

使用sip.conf或iax2.conf