文学城论坛
+A-

你这个太深奥了,会把菜鸟搞蒙。我前面的那个比较容易一瓢画葫芦

fitwxc 2011-08-16 18:07:31 ( reads)

nb = req.URI.User

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

case nb
 when /^1?\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d$/ then
  sys.GoogleVoiceCall("johnsmith@gmail.com","gv_password","ipkall_or_sipgate_#","#{nb}",".*",3)
  sys.Respond(480, "#{sys.Username} Not available")
 when /^\\+\\d{3,}/,/^00\\d{3,}/,/^011\\d{3,}/ then
  sys.Dial("VoipDiscount")
  sys.Respond(480, "#{sys.Username} Not available")
 else
  sys.Respond(480, "#{sys.Username} Not available")
end

跟帖(7)

mc3361

2011-08-16 21:10:24

精简版

fitwxc

2011-08-17 09:40:59

very neat!

mc3361

2011-08-17 10:34:40

要拨7位号码还要加几句

可说可不说

2011-08-17 11:49:25

回复:要拨7位号码还要加几句

mc3361

2011-08-17 13:18:01

你可以用其他voip/sip服务商,但是不能是sipsorcery,因为它不提供长途服务

可说可不说

2011-08-17 15:03:24

回复:你可以用其他voip/sip服务商,但是不能是sipsorcery,因为它不提供长途服务

mc3361

2011-08-17 15:49:24

voipdscount只是sipsorcery里SIP Provider的名称