由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
_voip版 - 有自动选择 GV Acc和Caller-ID的Sipsorcery Dial plan么?
相关主题
nonoh是不是国际的好选择?GV+Sipsorcery can't dial out today?
求教显示真正incoming CID而不是Sipgate的号码sipsorcery 怎么这么慢啊?
晕。ipkall也把来电号码改成自己的了。sipgate又有号码了,为什么这里这么淡定呢?
asterisk能不能实现这个功能谁能给个asterisk的教程啊
GV的Caller IDsipgate免费号管用么?
请教sipsorcery dial planGV打出又出问题了
Sipsorcery主页大变caller id?
asterisk 1.8的incoming call的问题asterisk 请教
相关话题的讨论汇总
话题: num话题: dial话题: number话题: gv话题: plan
1 (共1页)
j*****g
发帖数: 463
1
更新:
瞎蒙出来根据区号,选择性使用哪一 GV account。
但 CID 似乎还没弄出来。如果有大侠,能否帮忙搞定 CallerID,并检查一下语法. 多谢。
原问题和代码如下
==============================
用 SIPGate + GoogleVoice + SIPSorcery, 一直用 Simple Dial plan.
有哪位高人能发个具有如下功能的 Complex Dial plan 么?
1. 根据区号自动选择使用哪一 GV account.
本人有两个 GV account, 一个搬家前的区号,另一搬家后现在的区号。希望和老朋
友联系时用搬家前的号码。打现在本地时,使用新的号码。
2. 来电显示
现在来电显示在姓名处显示的是 SIPGate 的号码,在电话号码处显示的是对方真实号
码。希望能将 SIPGate 号码替换成对方实际姓名。
我知道网上的 Complex Dial plan 可以 Customize 实现上述功能。
想偷懒,如果谁有现成的直接能用最好。
另一方面也是实在忙得没空。
多谢。

Update:
========================
看了一下 SIPSorcery 的限制,对 free user 只是限制使用一个 dail plan,并非是限制不
能使用 Complex dail plan.
试了一下,Simple dial plan 实现多 GV 帐户也很简单.
就是在 Case Num 后根据情况直接 sys.GoogleVoiceCall
我的情况是搬家前的区号的电话用原来的老帐户 GVAcc1
搬家后的区号的电话用新帐户 GVAcc2
不过这 ruby 的语法我还是没有弄懂,全靠猜的。
下面是我的 Dial plan 如果你有类似的需求,可以套用。
另外,请大牛出手帮忙解决 CallerID 问题,和帮忙检查一下语法问题。
begin
sys.Log "** Call from #{req.Header.From} to #{req.URI.User} **"
if sys.Out # if outbound call
num = req.URI.User.to_s # Get a string copy of the number to
dial
case num
case num
when '911' then
sys.Dial('911@' + SG_PROVIDER_NAME)
when /@/ then sys.Dial num # URI dialing
when /^(321|312|\+)(\d{7,})/ # Desired area code
num = '1'+ num # prefix it with country and area code
sys.GoogleVoiceCall 'G****[email protected]', 'GVAcc1Pass',
'1987654321', num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30
when /^(011|00|\+)(\d{9,})/ # international number
num = '+' + $2 # GoogleVoiceCall works with '+'
prefix only
sys.GoogleVoiceCall 'G****[email protected]', 'GVAcc1Pass',
'1987654321', num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30
when /^[2-9]\d{6}$/ # Local call, 7-digit number
num = '1'+ AREA_CODE + num # prefix it with country and area code
sys.GoogleVoiceCall 'G****[email protected]', 'GVAcc2Pass',
'1987654321', num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30
when /^[01]?([2-9]\d{9})/ # US number with or without country
code
num = '1' + $1 # add country code and truncate number
to 10-digit
sys.GoogleVoiceCall 'G****[email protected]', 'GVAcc2Pass',
'1987654321', num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30
else sys.Respond 603, 'Wrong number, check & dial again'
end
sys.Log "Calling #{num} via Google Voice"
else # sys.Out
if sys.In # If incoming call...
name = req.Header.from.FromURI.User.to_s # get a copy of caller's
number
# Prefix 10-digit numbers with "1" (US country code).
# Some DID send Caller ID without country code
name = ('1' + name) if name =~ /^[2-9]\d\d[2-9]\d{6}$/
name.sub!(/^011/,'') # Remove 011 prefix added by Google Voice
sys.Log("FromName: '#{name}'")
req.Header.From.FromName = name # Set FromName for sys.Dial
# Change FromURI.User, too - or else Bria won't find contact in its
phonebook!
req.Header.from.FromURI.User = name
end
sys.Dial "#{sys.Username}@local"
end
rescue
sys.Log("** Error: " + $!) unless $!.to_s =~ /Thread was being
aborted./
end
l***h
发帖数: 9308
2
1. 你把楼上那个obi100收了吧,那个更好实现。sipsorcery搞complex要收费
2.sipgate的CID显示问题,在设置里面改

【在 j*****g 的大作中提到】
: 更新:
: 瞎蒙出来根据区号,选择性使用哪一 GV account。
: 但 CID 似乎还没弄出来。如果有大侠,能否帮忙搞定 CallerID,并检查一下语法. 多谢。
: 原问题和代码如下
: ==============================
: 用 SIPGate + GoogleVoice + SIPSorcery, 一直用 Simple Dial plan.
: 有哪位高人能发个具有如下功能的 Complex Dial plan 么?
: 1. 根据区号自动选择使用哪一 GV account.
: 本人有两个 GV account, 一个搬家前的区号,另一搬家后现在的区号。希望和老朋
: 友联系时用搬家前的号码。打现在本地时,使用新的号码。

a9
发帖数: 21638
3
等我的sip xmpp 转换器出炉,哈哈。

老朋
实号

【在 l***h 的大作中提到】
: 1. 你把楼上那个obi100收了吧,那个更好实现。sipsorcery搞complex要收费
: 2.sipgate的CID显示问题,在设置里面改

j*****g
发帖数: 463
4
请不吝指教细节?
能展开讲一下 “sipsorcery搞complex要收费”,是有代码行数限制
还是有功能限制?
OBI100 有什么新功能?我现在用的是 LinkSys SPA-2102R。
l***h
发帖数: 9308
5
具体限制参考 http://sipsorcery.wordpress.com/2011/08/02/final-reminder-to-be
ta-users/
sipgate看错你的提问

【在 j*****g 的大作中提到】
: 请不吝指教细节?
: 能展开讲一下 “sipsorcery搞complex要收费”,是有代码行数限制
: 还是有功能限制?
: OBI100 有什么新功能?我现在用的是 LinkSys SPA-2102R。

j*****g
发帖数: 463
6
看了一下 SIPSorcery 的限制,对 free user 只是限制使用一个 dail plan,并非是
限制不能使用 Complex dail plan.
试了一下,Simple dial plan 实现多 GV 帐户也很简单.
就是在 Case Num 后根据情况直接 sys.GoogleVoiceCall
参见一楼 Update.
另外,似乎 CallerID 还没有搞定,哪位大侠能帮忙贴个 CallerID 的 Dial Plan.
多谢。


be

【在 l***h 的大作中提到】
: 具体限制参考 http://sipsorcery.wordpress.com/2011/08/02/final-reminder-to-be
: ta-users/
: sipgate看错你的提问

1 (共1页)
相关主题
asterisk 请教GV的Caller ID
gv+sipgate+freepbx+ata, 15分钟限制?请教sipsorcery dial plan
问一下,版上有没大牛分享过asterisk的配置文件?Sipsorcery主页大变
电话机上显示来自gv的电话,waiting,是怎么回事asterisk 1.8的incoming call的问题
nonoh是不是国际的好选择?GV+Sipsorcery can't dial out today?
求教显示真正incoming CID而不是Sipgate的号码sipsorcery 怎么这么慢啊?
晕。ipkall也把来电号码改成自己的了。sipgate又有号码了,为什么这里这么淡定呢?
asterisk能不能实现这个功能谁能给个asterisk的教程啊
相关话题的讨论汇总
话题: num话题: dial话题: number话题: gv话题: plan