求教顯示真正incoming CID而不是Sipgate的號碼

來源: 2009-11-13 14:44:27 [舊帖] [給我悄悄話] 本文已被閱讀:

別人打入電話,通過GV -->SG -->SS -->ATA,在ATA上顯示的是SG的號碼,而不是真正打入者的CID。看了看之前fitwxc的帖子,可能我沒找對,沒找到答案。

google搜了一下,發現可以解決這個問題,但涉及ruby plan,不知道怎麽改。
http://www.mysipswitch.com/forum/viewtopic.php?t=1799

關鍵就是不知道該怎麽套用下麵這段
name = req.Header.from.FromURI.User.to_s ## if name =~ /^$|\D/



下麵是我目前的dial plan


#Ruby
# Dial Plan Generated by Rubyzard v0.1
# If you need help, please post in our forum
# http://www.mysipswitch.com

# SIP tracing : true or false
sys.Trace = false

sys.Log("call from #{req.Header.From.FromURI.ToString()} to #{req.URI.User}.")

if sys.In then
# Do your INCOMING call processing customisations here.
if sys.IsAvailable() then
sys.Dial("#{sys.Username}@local",30)
sys.Dial("Enter Number@SG",30)
sys.Respond(480, "#{sys.Username} Not available")
else
sys.Dial("Enter Number@SG",30)
sys.Respond(480, "#{sys.Username} Not available")
end

else
# Do your OUTGOING call processing customisations here.
case req.URI.User

when /^011/ then sys.Dial("nonoh")

#when /^1/ then sys.Dial("SG")
when /^1/ then sys.GoogleVoiceCall("full gail address", "GV password", "SG #", "#{req.URI.user}","GV#")
else sys.Dial("SG")
end