Reg.allow only incoming calls

Hi,

i have one requirment like i need to setup an extensions and need allow only incoming calls from PSTN and need allow to within extensions.

Basic requirement is to restrict the outbound PSTN calls for this extensions and should allow within ext…

As for following setup and config. i am able to receive only incoming from PSTN and unable to have calls with in ext 294 and 218 … though i have entires for sip.conf

Here i am trying to setup the ext 254 for this requirment.

i shall be thankfull if you can help me on the same…

i have the following setup in my sip.conf with entries for 218 and 294 with context abc

[254]
type=peer
secret=new
host=dynamic
qualify=yes
disallow=all
;allow=ulaw
allow=g729
context=abcd
dtmfmode=rfc2833
;nat=yes
careinvite=yes
insecure=invite
mailbox=254@voicemail

estensions.conf

[default]

include => abc
include => abcd

exten => s,1,Wait(1)
exten => s,2,Answer()
exten => s,3,Background(welcome)
exten => s,4,WaitExten(10)
exten => s,5,Background(welcome)
exten => s,6,WaitExten(10)
exten => s,7,Goto(280,1)
exten => s,8,Hangup()

[abc]

exten => _NXXNXXXXXX,1,Dial(Zap/G1/wwwwww1${EXTEN}|20,tWw)
exten => _NXXNXXXXXX,2,Congestion()
exten => _NXXNXXXXXX,102,busy()

exten => 294,1,Dial(SIP/294,20,rtT)
exten => 294,2,VoiceMail(294@voicemail)
exten => 294,3,PlayBack(vm-goodbye)
exten => 294,4,Hangup()

exten => 218,1,Dial(SIP/218,20,rtT)
exten => 218,2,VoiceMail(218@voicemail)
exten => 218,3,PlayBack(vm-goodbye)
exten => 218,4,Hangup()

[abcd]
exten => 254,1,Dial(SIP/254,20,rtT)
exten => 254,2,voicemail(254@voicemail)
exten => 254,3,Playback(vm-goodbye)
exten => 254,4,Hangup()

put the extension blocks for 294 and 218 in context abcd and include abcd in abc.

Hi,

Does that mean whenever i create an extension in abc do i need duplicate in acbd also… ?

since i have the outbound calls config in context abc, when i include in abcd in abc context, then the user 254 also be also having the access to outbound calls right…

no, read what i posted. create the extensions that everyone has access to in the [abcd] context and then “include” that in the [abc] context. then users who “start” in [abc] get access to everything in [abcd] but users in [abcd] can only get extensions in [abcd]

Hi,

I understood sir, but my key thing extensions in [abcd] will also able to call the extensions [abc] and vice versa… and extensions in [abcd] should not be allowed out to make outbound calls through zap channels…

Thanks in advance

Try this

take the current from-internal context
copy to a new context [localonly]
remove the line which has the outbound trunk

There are other ways as well

Here is my

[localonly]
include => localonly-custom
include => app-echo-test
include => app-recordings
include => app-speakextennum
include => app-speakingclock
include => ext-local
include => ext-meetme
include => ext-test

; end of [localonly]

[ext-local]
include => ext-local-custom
exten => 3100,1,Macro(exten-vm,3100,3100)
exten => 3100,n,Hangup
exten => 3100,hint,IAX2/3100
exten => ${VM_PREFIX}3100,1,Macro(vm,3100,DIRECTDIAL)
exten => ${VM_PREFIX}3100,n,Hangup
exten => 4100,1,Macro(exten-vm,4100,4100)
exten => 4100,n,Hangup
exten => 4100,hint,IAX2/4100
exten => ${VM_PREFIX}4100,1,Macro(vm,4100,DIRECTDIAL)
exten => ${VM_PREFIX}4100,n,Hangup
exten => 10000,1,Macro(exten-vm,10000,10000)
exten => 10000,n,Hangup
exten => 10000,hint,IAX2/10000
exten => ${VM_PREFIX}10000,1,Macro(vm,10000,DIRECTDIAL)
exten => ${VM_PREFIX}10000,n,Hangup

; end of [ext-local]