如何将变量传递给dailplan.rb文件。
拨号'SIP/976',:用于=> 15秒
如何才能从文件外部指定扩展名。
发布于 2012-07-10 01:15:50
我想你只是在谈论Ruby字符串插值。将拨打的分机设为变量的最简单方法是使用Ruby:
myexten = '976'
dial "SIP/#{myexten}", :for => 15.seconds如果要使用#{}将变量插入到字符串中,请记住使用双引号。
您可能还引用了星号通道变量。假设我们讨论的是Adearsion1.x,如果您想在拨号之前设置一个变量,请使用#set_variable语法:
set_variable 'MYVAR', "this is the value of the MYVAR channel variable"
set_variable 'OUTBOUND_GROUP', 'group1'
dial 'SIP/976', :for => 15.seconds如果您想要检索频道变量的值(如#dial设置的值),您可以使用get_variable:
dial 'SIP/976', :for => 15.seconds
ahn_log.info "Call completed with status #{get_variable 'DIALSTATUS'}"https://stackoverflow.com/questions/8918206
复制相似问题