Hi.
I wonder if I can block outgoing calls to certain pattern ?
I also wonder how its possible for a stranger in another country to make calls trough my asterisk ?
Dosent the extension he use match my sip.conf ?
I see in the cdr logfile (mysql actually) that the call was made from “sip/xxx.xxx.xxx.xxx-xxxxxx” instead of one of my phones/extensions. How is it possible ?
And, how do I prevent that in the future ?
Lets say I want to allow all call except the one that starts with 44, how will i write that in my extensions.conf ?
Edit: Forgot, the version i run is: Asterisk 1.6.0.5
Run it on Ubuntu server
[code]SIP.CONF:
[general]
context=default
port=5060 ; UDP port for Asterisk
bindaddr=0.0.0.0
externip=<MY_DOMAIN>
localnet=192.168.1.0/255.255.255.0
srvlookup=yes ; Enable DNS SRV server
nat=no
disallow=all
allow=ulaw
register => USER:PASSWD@<MY_VOIP_PROVIDER>/200
[call_out]
type=friend
host=<VOIP_PROVIDER_SERVER>
fromdomain=<VOIP_PROVIDER_DOMAIN>
progressinband=yes
nat=no
canreinvite=no
qualify=yes
insecure=port,invite
username=
fromuser=
secret=
dtmfmode=inband
disallow=all
allow=ulaw
[200]
type=friend
secret=
nat=no ; Telephone without NAT
insecure=port,invite
host=dynamic ; the devices can be registered with different IPs each time
canreinvite=no ; Asterisk by default redirects
disallow=all
allow=ulaw
…
…
.
---------------------------------------------------------------[/code]
[code]
EXTENSIONS.CONF
[general]
static=yes
writeprotect=no
clearglobalvars=no
[default]
include => day,10:31-23:59,mon,,
include => day,,tue-thu,,*
include => day,07:00-14:29,fri,,
include => helg,,sat-sun,,*
include => helg,00:01-10:30,mon,,
include => helg,14:30-23:59,fri,,
; Computer basement
exten => 200,1,Wait(1)
exten => 200,2,Dial(SIP/200,60)
exten => 200,3,Hangup
; Call out
; exten => _044X.,1,Hangup
exten => _0X.,1,Dial(SIP/${EXTEN:1}@call_out,r)
exten => _0X.,n,Hangup
[day]
exten => 200,1,Wait(1)
exten => 200,2,Dial(SIP/400,60)
exten => 200,3,Hangup
[helg]
exten => 200,1,Wait(1)
exten => 200,2,Dial(SIP/200,60)
exten => 200,3,Hangup
---------------------------------------------------------------[/code]