 |
|
|
| tr>
| 阅读上一个主题 :: 阅读下一个主题 |
| 作者 |
正文 |
小兵 混个脸熟

加入时间: 2006/11/13 文章: 10
|
1楼 时间: 2006-11-13 周一, 下午4:50 标题: 怎样才能限制打长途? |
|
|
小弟初次来此,请多关照!
我装了TrixBox. 现在有一个问题,就是如何限制某些分机,让他们只能打本地电话,不能拨打长途。请各位前辈指教!谢谢! |
|
| 返回顶端 |
|
 |
Google Sponsor
|
时间: 2006-11-13 周一, 下午4:50 标题: Advertisement |
|
|
|
|
| 返回顶端 |
|
 |
VoIPer 版主


加入时间: 2006/11/07 文章: 58
|
2楼 时间: 2006-11-14 周二, 上午7:58 标题: |
|
|
欢迎小兵!
限制内线分机拨打长途,最简单的方法是在out bound route上设置密码。
如果你不想用密码,而是针对分机,那就要做一些手工的修改了,其实也不是很麻烦。 |
|
| 返回顶端 |
|
 |
VoIPer 版主


加入时间: 2006/11/07 文章: 58
|
3楼 时间: 2006-11-14 周二, 上午9:47 标题: |
|
|
这个例子也许对你有帮助。
先来看一下系统环境:我有一个设置好的TrixBox,内线分机111(SIP 电话),112(IAX 软电话),113,....等等。有两个SIP outbound route, 一个是用来拨打本地电话。另一个用来拨打长途,用来拨打长途。当所有的基本设置通过FreePBX完成后,所有的分机均可以任意拨出本地电话或长途电话。
目的:限制分机111和112,使它们只能拨打本地电话,不能拨打长途电话。其他的分机不做任何限制。
好了,让我们看一下此时分机的设置:打开任意一个分机的设置,无论是SIP或IAX,我们可以看到,其context 全是 from-internal,也就是说,当用户拨打电话时,要服从[from-internal]的规定。
现在我要建立一个新的[from-restricted],在里面不设置长途的route。然后,把111和112的context 改成 [from-restricted] ,这样,111和112就不能拨打长途电话了。
下面,我就用TrixBox的Config Edit来创建这个新的context。
打开两个浏览器窗口(或者两个Tab),在Config Edit下打开extensions_additional.conf 文件,在左面点击outbound-allroutes,就会看到:
[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-LocalCall
include => outrt-002-LongDistance
exten => foo,1,Noop(bar)
; end of [outbound-allroutes]
|
其中,outrt-001-LocalCall 就是本地电话的route, outrt-002-LongDistance 是长途的route。
(注:你的文件会和我的不同,但基本格式应该是这样的)
我们要将上面的几行COPY到我们新建的context中去,所以,将此窗口开着,我们转换到另一个窗口。
在第二个窗口里,同样打开extensions_custom.conf 。好了,现在加上下面这一段:
[from-restricted]
;
; These are all the applications that you will require
;
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
include => app-cf-off
include => app-cf-off-any
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => app-calltrace
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-dialvm
include => app-directory
include => app-dnd-off
include => app-dnd-on
include => app-echo-test
include => app-recordings
include => app-speakextennum
include => app-speakingclock
include => app-userlogonoff
include => app-zapbarge
include => app-vmmain
include => ext-group
include => ext-fax
include => ext-meetme
include => ext-findmefollow
include => ext-paging
include => ext-queues
include => ext-test
include => ext-local
include => parkedcalls
;
; #### OutBound Routes ########
; # Below are all outbound routes #
; ###########################
;
;[outbound-allroutes]
;include => outbound-allroutes-custom
include => outrt-001-LocalCall
;include => outrt-002-LongDistance
exten => foo,1,Noop(bar)
; end of [outbound-allroutes]
;
exten => h,1,Hangup
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)
;
|
大概解释一下上面这一大段的意思:前面的很多行都是拨出电话时有可能会用到的程序,接下来的[outbound-allroutes]小节是从另一个窗口中COPY过来的,注意 我在include => outrt-002-LongDistance语句前面加上了分号“;”, 这样就把长途的route给停止了! 最后是几行收尾语句。
别忘了存盘!
好了,现在回到TrixBox的extensions 设置,打开111分机的设置页,将context改成 from-restricted,同样对112也作这个改动。
这时,从111和112分机就拨不出长途电话了。  |
|
| 返回顶端 |
|
 |
小兵 混个脸熟

加入时间: 2006/11/13 文章: 10
|
4楼 时间: 2006-11-14 周二, 下午4:35 标题: |
|
|
wow, 太棒了!我这就去试一下。 谢谢老大!  |
|
| 返回顶端 |
|
 |
dfxuyang 初来乍到

加入时间: 2007/11/12 文章: 1
|
5楼 时间: 2007-11-12 周一, 上午9:53 标题: |
|
|
请教下版主,我按照您给出的方法获得了成功,但是我升级到Trixbox2.5现在同样的配置,不过用户什么电话都不能打了,想请教下为什么。附上配置:
[from-internal-custom]
include => from-internal-trixbox
;1234,1,Playback(demo-congrats) ; extensions can dial 1234
;1234,2,Hangup()
;h,1,Hangup()
;include => custom-recordme ; extensions can also dial 5678
; custom-count2four,s,1 can be used as a custom target for
; a Digital Receptionist menu or a Call Group
;[custom-count2four]
;s,1,SayDigits(1234)
;s,2,Hangup
; custom-recordme,5678,1 can be used as a custom target for
; a Digital Receptionist menu or a Call Group
;[custom-recordme]
;exten => 5678,1,Wait(2)
;exten => 5678,2,Record(/tmp/asterisk-recording:gsm)
;exten => 5678,3,Wait(2)
;exten => 5678,4,Playback(/tmp/asterisk-recording)
;exten => 5678,5,Wait(2)
;exten => 5678,6,Hangup
[from-restricted]
;
; These are all the applications that you will require
;
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
include => app-cf-off
include => app-cf-off-any
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => app-calltrace
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-dialvm
include => app-directory
include => app-dnd-off
include => app-dnd-on
include => app-echo-test
include => app-recordings
include => app-speakextennum
include => app-speakingclock
include => app-userlogonoff
include => app-zapbarge
include => app-vmmain
include => ext-group
include => ext-fax
include => ext-meetme
include => ext-findmefollow
include => ext-paging
include => ext-queues
include => ext-test
include => ext-local
include => parkedcalls
;
; #### OutBound Routes ########
; # Below are all outbound routes #
; ###########################
;
;[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-LocalCall
include => outrt-002-Company
;include => outrt-003-LongDistance
exten => foo,1,Noop(bar)
; end of [outbound-allroutes]
;
exten => h,1,Hangup
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)
; |
|
| 返回顶端 |
|
 |
|
|
您不能在本论坛发表新主题 您不能在本论坛回复主题 您不能在本论坛编辑自己的文章 您不能在本论坛删除自己的文章 您不能在本论坛发表投票 您 无法 在这个版面上传附件 您 可以 在这个版面下载附件
|
Powered by phpBB © 2001, 2005 phpBB Group
|