sipsorcery dial plan - GV + voipdiscount

來源: mc3361 2011-08-16 15:37:08 [] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (1684 bytes)
本文內容已被 [ mc3361 ] 在 2011-08-17 05:21:53 編輯過。如有問題,請報告版主或論壇管理刪除.

下麵是一個用Google Voice打美加電話, voipdiscount打其它國家電話的

sipsorcery dial plan

撥號時,打美加直接撥 12125551212,或者 2125551212

打中國或其它國家,011 + 國家號 + 地區號 + 電話號 比如 011861012345678

撥號也可以用國際通用的 + 國家號 + 地區號 + 電話號 比如 +12125551212, +861012345678

==  begin dial plan ============

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

AREA_code = "212" # your area code for 7 digits dialling
GV_name = "my_name@gmail.com" # google voice account name
GV_pass = "mypass_1234" # google voice account password
GV_callback = "2535551212" # google voice call back number
SIP_provider = "voipdiscount" # SIP provider name for international calling

num = req.URI.User.to_s

# re-format telephone number ###

num = num.sub(/^011/,'+') # 011 86 xxx to +86 xxx
num = num.sub(/^00/, '+') # 001 212 xxx to +1 212 xxx

case num
when /^[2-9]d{6}$/ # 7 digits number, add area code
    num = "+1" + AREA_code + num
when /^[1]d{10}$/ # 1 212 555 1212, add +
   num = "+" + num
when /^d{10}$/ # 212 555 1212, add +1
   num = "+1" + num
end

# end of re-format ###

sys.Log ("Final Dial Number = " + num)

case num
# Use Voipdiscount for non US/Canadian numbers
when /^\\+[^1]/,/^\\+1684/,/^\\+1264/,/^\\+1268/,/^\\+1242/,\
     /^\\+1246/,/^\\+1441/,/^\\+1284/,/^\\+1345/,/^\\+1767/,\
     /^\\+1809/,/^\\+1473/,/^\\+1671/,/^\\+1876/,/^\\+1664/,\
     /^\\+1670/,/^\\+1869/,/^\\+1758/,/^\\+1599/,/^\\+1784/,\
     /^\\+1868/,/^\\+1649/,/^\\+1340/
   sys.Dial(num + "@" + SIP_provider)
else
    sys.GoogleVoiceCall(GV_name,GV_pass,GV_callback, num, ".*",3)
end

 

所有跟帖: 

sipsorcery裏voipdiscount的設置方法 -mc3361- 給 mc3361 發送悄悄話 (298 bytes) () 08/16/2011 postreply 15:42:54

你這個太深奧了,會把菜鳥搞蒙。我前麵的那個比較容易一瓢畫葫蘆 -fitwxc- 給 fitwxc 發送悄悄話 fitwxc 的博客首頁 (595 bytes) () 08/16/2011 postreply 18:07:31

精簡版 -mc3361- 給 mc3361 發送悄悄話 (340 bytes) () 08/16/2011 postreply 21:10:24

very neat! -fitwxc- 給 fitwxc 發送悄悄話 fitwxc 的博客首頁 (0 bytes) () 08/17/2011 postreply 09:40:59

要撥7位號碼還要加幾句 -mc3361- 給 mc3361 發送悄悄話 (414 bytes) () 08/17/2011 postreply 10:34:40

回複:要撥7位號碼還要加幾句 -可說可不說- 給 可說可不說 發送悄悄話 (153 bytes) () 08/17/2011 postreply 11:49:25

你可以用其他voip/sip服務商,但是不能是sipsorcery,因為它不提供長途服務 -mc3361- 給 mc3361 發送悄悄話 (0 bytes) () 08/17/2011 postreply 13:18:01

回複:你可以用其他voip/sip服務商,但是不能是sipsorcery,因為它不提供長途服務 -可說可不說- 給 可說可不說 發送悄悄話 (165 bytes) () 08/17/2011 postreply 15:03:24

voipdscount隻是sipsorcery裏SIP Provider的名稱 -mc3361- 給 mc3361 發送悄悄話 (0 bytes) () 08/17/2011 postreply 15:49:24

請您先登陸,再發跟帖!

發現Adblock插件

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

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

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

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