粘附的变量
如何将变量传递到 daiplan.rb 文件。
拨打'SIP/976', :for => 15.seconds
我怎样才能做到这一点,以便我可以从文件外部指定扩展名。
How can I pass in a variable to the dailplan.rb file.
dial 'SIP/976', :for => 15.seconds
How can I make it so that I can specify the extension from outside the file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你只是在谈论 Ruby 字符串插值。制作拨号扩展变量的最简单方法是使用 Ruby:
如果要使用 #{} 将变量插入字符串,请记住使用双引号。
您可能还指的是 Asterisk 通道变量。假设我们正在讨论 Adhearsion 1.x,如果您想在拨号之前设置变量,请使用 #set_variable 语法:
如果您想检索通道变量的值(例如作为 # 的结果而设置的值) dial) 你可以使用 get_variable:
I think you are just talking about Ruby string interpolation. The easiest way to make the dialed extension variable is to use Ruby:
Remember to use double quotes if you are going to use the #{} to insert a variable into the string.
You may also be referring to Asterisk channel variables. Assuming we are talking about Adhearsion 1.x, if you want to set a variable prior to the dial, use the #set_variable syntax:
If you want to retrieve the value of a channel variable (such as those set as a result of the #dial) you can use get_variable: