#{req.URI.User} 和req.URI.User 分別指代什麽?

來源: 犬友 2011-04-25 18:59:49 [] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (1456 bytes)

if sys.In then
# Do your INCOMING call processing customizations here.
    if sys.IsAvailable("#{req.URI.User}","sipsorcery.com") then #這兒的#{req.URI.User}看起來是我的GV號碼
      sys.Dial("#{req.URI.User}@local",30)
       sys.Respond(480, "#{req.URI.User} Not available")
    else
       sys.Respond(480, "#{req.URI.User} Not available")
    end
 
else

case req.URI.User   #這兒的 req.URI.User看起來像是要呼叫的號碼
  when /^011/ then sys.Dial("VD" )  
else
  sys.GoogleVoiceCall("username@gmail.com", "password", "1206xxxxxxx","#{req.URI.User}",".*",1,30) #這兒的 #{req.URI.User}看起來像是要呼叫的號碼

end
end

我有兩個sip account,需要兩個單獨的dialplan。按照sipsorcery的新政隻能有一個,正在研究怎麽加一個case的選擇。比如:

case ?

 when GVnumber1 then

    sys.GoogleVoiceCall("username1@gmail.com", "password1", "1206xxxxxx1","#{req.URI.User}","?",1,30)

when GVnumber1 then

    sys.GoogleVoiceCall("username2@gmail.com", "password2", "1206xxxxxx2","#{req.URI.User}","?",1,30)

?為我正在找的含有主叫用戶信息的一個變量

哪位高手能指點一下,謝謝

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”