1
1.1 Pengertian VOIP.
VoIP (Voice over Internet Protocol) merupakan nama lain internet telephony.
Internet telephony adalah hardware dan software yang memungkinkan
pengguna Internet untuk media transmisi panggilan telepon. Kualitas Internet
telephony ini belum sebaik kualitas koneksi telepon langsung. Voice over
Internet Protocol (VoIP) adalah teknologi yang mampu melewatkan trafik
suara, video dan data yang berbentuk paket melalui jaringan IP.
Dalam komunikasi VoIP, pemakai melakukan hubungan telepon melalui
terminal yang berupa PC atau telepon. Terminal akan berkomunikasi dengan
gateway melalui telefoni lokal. Hubungan antar gateway dilakukan melalui
network IP.
Network IP dapat berupa network paket apapun, termasuk ATM, FR, Internet,
Intranet, atau line E1. VoIP menawarkan transportasi sinyal yang lebih murah,
feature tambahan, dan transparansi terhadap data komputer. Hambatan VoIP
saat ini adalah kehandalannya yang di bawah telefoni biasa, dan soal
standarisasi yang akan menyangkut masalah interoperabilitas.
2
1.3 KELEMAHAN VOIP
3
1.4 CARA KERJA VOIP
Hal yang menarik tentang VoIP adalah banyaknya cara untuk melakukan
panggilan. Saat ini ada 3 jenis metode yg berbeda yang paling sering
digunakan untuk melakukan layalan VoIP, yaitu :
2. IP Phones
Pesawat telepon khusus ini kelihatannya sama dengan telepon biasa.
Tapi selain mempunyai konektor RJ-11 standar, IP Phones juga
mempunyai konektor RJ-45. IP Phones menghubungkan langsung dari
telepon ke router, dan didalam IP Phones sudah ada semua perangkat
keras maupun lunak yang sudah terpasang didalamnya yang
menunjang melakukan pemanggilan IP. Tidak lama lagi, IP Phone
nirkabel (wireless) akan tersedia, dan memungkinkan para pengguna
untuk melakukan panggilan VoIP dari hotspot yang tersedia.
3. Computer-to-Computer
Cara ini jelas merupakan cara paling mudah untuk melakukan
panggilan VoIP. Anda bahkan tidak usah membayar satu sen pun untuk
melakukan panggilan SLJJ. Ada beberapa perusahaan yang
menawarkan program yang harganya murah bahkan gratis yang dapat
digunakan untuk melakukan panggilan VoIP. Yang harus anda sediakan
hanya program (software), mikrofon, speaker, soundcard dan koneksi
internet, lebih diutamakan koneksi internet yang relatif cepat seperti
koneksi Kabel atau DSL. Selain biaya bulanan ISP, biasanya tidak ada
lagi biaya untuk panggilan Computer-to-Computer, seberapa jauh pun
jaraknya.
4
1.5 Protokol Penunjang Jaringan VoIP
Ada beberapa protokol yang menjadi penunjang jaringan VoIP, antara lain :
2. Application layer
Fungsi utama lapisan ini adalah pemindahan file. Perpindahan file dari
sebuah sistem ke sistem lainnya yang berbeda memerlukan suatu
sistem pengendalian untuk menangatasi adanya ketidak cocokan sistem
file yang berbeda beda. Protokol ini berhubungan dengan aplikasi.
Salah satu contoh aplikasi yang telah dikenal misalnya HTTP (Hypertext
Transfer Protocol) untuk web, FTP(File Transfer Protocol) untuk
perpindahan file, dan TELNET untuk terminal maya jarak jauh.
1.6 REGULASI
6
Persaingan menyebabkan setiap perusahaan berusaha menghasilkan
inovasi/produk baru. Karena adanya resiko investasi, pemerintah AS turut
membantu dengan mengurangi pajak guna membantu inovasi dan memacu
potensial market dengan mensupport perusahaan pengembang teknologi (The
National Institute for Standards and Technology, National Institues of Health,
National Oceanic and Atmospheric Administration, dan the National Science
Foundation).
7
INSTALASI VOIP SERVER UNILA
8
2.1 Instalasi
Lainnya.
Catatan :
• Ketik netconfig
• Pilih Yes
• Isi IP Address, Netmask, Default Gateway (IP) dan Primary Name server
• Pilih OK
9
2.3 Konfigurasi TRIXBOX
10
• Klik System Administration Untuk masuk ke menu System administration
11
2.4 Menu System Administration
12
• Klik Menu Tools
13
2.5 Menu Tools
14
• Beri Tanda centang pada Core (core)
15
2.6 Menu Setup
16
Menu Add SIP Extensions
membuat/menambahkan Client.
17
• Klik You have made changes-when finished, click here to APPLY them
18
2.7 Peering ke voiprakyat.or.id
• Host = Voiprakyat.or.id
• username = voiprakyat.or.id
• Secret= Password
• Register String :
(Username : password@voiprakyat.or.id)
menyelesaikan konfigurasi
19
• Klik You have made changes-when finished, click here to
Outbound Routes
20
• Klik You have made changes-when finished, click here to APPLY
KETERANGAN
• Extensions
• Trunks
• Outbound Routes
21
2.8 Konfigurasi interkoneksi VOIP server dengan PABX Siemens UNILA.
zttool.*
22
berikut isi file zapata-auto.conf
signalling=fxs_ks
context=from-pstn
group=0
channel => 1
echocancel=yes
echocancelwhenbridged=yes
echotraining=yes
ZAP/g0
23
Selanjutnya ubah file /etc/zaptel.conf
loadzone = uk
defaultzone = uk
> cd /usr/src
24
edit beberapa file config berikut
/etc/zaptel.conf
fxsks=1 ;AX-100P
defaultzone=uk
loadzone=uk
/etc/asterisk/zapata.conf
[channels]
signalling=fxs_ks
context=incoming
channel=>1 ; AX-100P
/etc/asterisk/extensions.conf
[incoming]
berikut
25
Proses instalasi interkoneksi dari VOIP server ke PABX analog telah
selesai ketik command berikut untuk melihat aktifitas di server VOIP
26
2.9 Petunjuk penggunaan Softphone Client (X-lite 3.0).
27
28
29
30
31
32
33
34
35
2.10 Lampiran File konfigurasi;
- Asterisk.conf
[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
[options]
transmit_silence_during_record = yes
; nocolor = yes
- cdr_mysql.conf
;
; Note - if the database server is hosted on the same machine as the
; asterisk server, you can achieve a local Unix socket connection by
; setting hostname=localhost
;
; port and sock are both optional parameters. If hostname is specified
; and is not "localhost", then cdr_mysql will attempt to connect to the
; port specified or use the default port. If hostname is not specified
; or if hostname is "localhost", then cdr_mysql will attempt to connect
; to the socket file specified by sock or otherwise use the default socket
; file.
;
[global]
hostname=localhost
dbname=asteriskcdrdb
password=amp109
user=asteriskuser
;port=3306
;sock=/tmp/mysql.sock
36
- codec.conf
[speex]
quality => 3
complexity => 2
abr => 0
37
; VBR encoding quality [0-10]
vbr_quality => 4
; preprocessor configuration
38
[plc]
- extconfig.conf
;
; Static and realtime external configuration
; engine configuration
;
; Please read doc/README.extconfig for basic table
; formatting information.
;
[settings]
;
; Static configuration files:
;
; file.conf => driver,database[,table]
;
; maps a particular configuration file to the given
; database driver, database and table (or uses the
; name of the file as the table if not specified)
;
;uncomment to load queues.conf via the odbc engine.
;
;queues.conf => odbc,asterisk,ast_config
;
; The following files CANNOT be loaded from Realtime storage:
; asterisk.conf
; extconfig.conf (this file)
; logger.conf
;
; Additionally, the following files cannot be loaded from
39
; Realtime storage unless the storage driver is loaded
; early using 'preload' statements in modules.conf:
; manager.conf
; cdr.conf
; rtp.conf
;
;
; Realtime configuration engine
;
; maps a particular family of realtime
; configuration to a given database driver,
; database and table (or uses the name of
; the family if the table is not specified
;
;example => odbc,asterisk,alttable
;iaxusers => odbc,asterisk
;iaxpeers => mysql,asteriskrealtime,iax_buddies
;sipusers => odbc,asterisk
;sippeers => mysql,asteriskrealtime,sip_buddies
;voicemail => mysql,asteriskrealtime,voicemail_users
;extensions => mysql,asteriskrealtime,extensions
;queues => odbc,asterisk
;queue_members => odbc,asterisk
- extension.conf
; FreePBX
; Copyright (C) 2004 Coalescent Systems Inc (Canada)
; Copyright (C) 2006 Why Pay More 4 Less Pty Ltd (Australia)
; Released under the GNU GPL Licence version 2.
; dialparties.agi (http://www.sprackett.com/asterisk/)
; Asterisk::AGI (http://asterisk.gnuinter.net/)
; gsm
(http://www.ibiblio.org/pub/Linux/utils/compress/!INDEX.short.ht
ml)
; loligo sounds (http://www.loligo.com/asterisk/sounds/)
; mpg123 (http://voip-info.org/wiki-
Asterisk+config+musiconhold.conf)
40
; include extension contexts generated from AMP
#include extensions_additional.conf
[from-pstn]
include => from-pstn-custom ; create this context in
extensions_custom.conf to include customizations
include => ext-did-direct ; MODIFICATOIN (PL) put before
ext-did to take precedence
include => ext-did
include => from-did-direct ; MODIFICATOIN (PL) for
findmefollow if enabled, should be bofore ext-local
exten => fax,1,Goto(ext-fax,in_fax,1)
; MODIFICATION (PL)
;
; Required to assure that direct dids go to personal ring group before
local extension.
; This could be auto-generated however I it is prefered to be put here
and hard coded
; so that it can be modified if ext-local should take precedence in
certain situations.
; will have to decide what to do later.
;
[from-did-direct]
include => ext-findmefollow
include => ext-local
41
;
#########################################################
###################
; Macros [macro]
;
#########################################################
###################
42
exten => s,35,GotoIf($[$["${CALLTRACE_HUNT}" != "" ] &
$["${RingGroupMethod}" = "memoryhunt" ]]?36:50 ) ;Set Call Trace for
each hunt member we are going to call "Memory groups have multiple
members to set CALL TRACE For hence the loop
exten => s,36,Set(CTLoop=0)
exten => s,37,GotoIf($[${CTLoop} > ${HuntLoop}]?42 ) ; if this is from
rg-group, don't strip prefix
exten => s,38,Set(CT_EXTEN=${CUT(ARG3,,$[${CTLoop} + 1])})
exten =>
s,39,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
exten => s,40,Set(CTLoop=$[1 + ${CTLoop}])
exten => s,41,Goto(s,37)
; make sure hungup calls go here so that proper cleanup occurs from
call confirmed calls and the like
;
exten => h,1,Macro(hangupcall)
43
exten => s,n,Macro(record-enable,${EXTTOCALL},IN)
[macro-vm]
exten => s,1,Macro(user-callerid,SKIPTTL)
44
exten =>
s,n,Set(VMGAIN=${IF($["foo${VM_GAIN}"!="foo"]?"g(${VM_GAIN})":"")})
;
; If BLKVM_OVERRIDE is set, then someone told us to block calls
from going to
; voicemail. This variable is reset by the answering channel so
subsequent
; transfers will properly function.
;
exten => s,n,GotoIf($["foo${DB(${BLKVM_OVERRIDE})}" !=
"fooTRUE"]?s-${ARG2},1)
;
; we didn't branch so block this from voicemail
;
exten => s,n,Noop(CAME FROM: ${NODEST} - Blocking VM cause of
key: ${DB(BLKVM_OVERRIDE)})
45
exten => o,n,GotoIf($["x${OPERATOR_XTN}"="x"]?nooper:from-
internal,${OPERATOR_XTN},1)
exten => o,n(nooper),GotoIf($["x${FROM_DID}"="x"]?nodid)
exten => o,n,Dial(Local/${FROM_DID}@from-pstn)
exten => o,n,Macro(hangup)
exten => o,n(nodid),Dial(Local/s@from-pstn)
exten => o,n,Macro(hangup)
;------------------------------------------------------------------------
; [macro-simple-dial]
;------------------------------------------------------------------------
; This macro was derived from macro-exten-vm, which is what is
normally used to
; ring an extension. It has been simplified and designed to never go to
voicemail
; and always return regardless of the DIALSTATUS for any incomplete
call.
;
; It's current primary purpose is to allow findmefollow ring an
extension prior
; to trying the follow-me ringgroup that is provided.
;
; Ring an extension, if the extension is busy or there is no answer,
return
; ARGS: $EXTENSION, $RINGTIME
46
;------------------------------------------------------------------------
[macro-simple-dial]
exten => s,1,Macro(user-callerid,SKIPTTL) ; already called from follow-
me
; Nothing yet, then go to the end (which will just return, but in case
we decide to do something with certain
; return situations, this is left in.
;
exten => s,n,Goto(s-${DIALSTATUS},1)
47
; Try the Call Forward on No Answer / Unavailable number.
; We want to try CFU if set, but we want the same ring timer as was
set to our call (or do we want the
; system ringtimer? - probably not). Then if no answer there
(assuming it doesn't drop into their vm or
; something we return, which will have the net effect of returning to
the followme setup.)
;
; want to avoid going to other follow-me settings here. So check if the
CFUEXT is a user and if it is
; then direct it straight to ext-local (to avoid getting intercepted by
findmefollow) otherwise send it
; to from-internal since it may be an outside line.
;
exten => docfu,1,GotoIf( $[ "foo${DB(AMPUSER/${CFUEXT}/device)}" =
"foo" ]?chlocal)
exten => docfu,n,Dial(Local/${CFUEXT}@ext-
local,${RT},${DIAL_OPTIONS})
exten => docfu,n,Return
exten => docfu,n(chlocal),Dial(Local/${CFUEXT}@from-
internal/n,${RT},${DIAL_OPTIONS})
exten => docfu,n,Return
; In all cases of no connection, come here and simply return, since the
calling dialplan will
; decide what to do next
exten => _s-.,1,NoOp(Extension is reporting ${EXTEN})
;------------------------------------------------------------------------
48
; get the voicemail context for the user in ARG1
[macro-get-vmcontext]
exten => s,1,Set(VMCONTEXT=${DB(AMPUSER/${ARG1}/voicemail)})
exten => s,2,GotoIf($["foo${VMCONTEXT}" = "foo"]?200:300)
exten => s,200,Set(VMCONTEXT=default)
exten => s,300,NoOp()
;
; Outgoing channel(s) are busy ... inform the client
49
; but use noanswer features like ringgroups don't break by being
answered
; just to play the message.
;
[macro-outisbusy]
exten => s,1,Playback(all-circuits-busy-now,noanswer)
exten => s,n,Playback(pls-try-call-later,noanswer)
exten => s,n,Macro(hangupcall)
; What to do on hangup.
[macro-hangupcall]
exten => s,1,ResetCDR(w)
exten => s,n,NoCDR()
[macro-faxreceive]
exten => s,1,Set(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif)
exten => s,2,Set(EMAILADDR=${FAX_RX_EMAIL})
exten => s,3,rxfax(${FAXFILE})
exten => s,103,Set(EMAILADDR=${FAX_RX_EMAIL})
exten => s,104,Goto(3)
50
; dialout and strip the prefix
[macro-dialout]
exten => s,1,Macro(user-callerid,SKIPTTL)
exten => s,2,GotoIf($["${ECID${CALLERID(number)}}" = ""]?5)
;check for CID override for exten
exten => s,3,Set(CALLERID(all)=${ECID${CALLERID(number)}})
exten => s,4,Goto(7)
exten => s,5,GotoIf($["${OUTCID_${ARG1}}" = ""]?7) ;check for
CID override for trunk
exten => s,6,Set(CALLERID(all)=${OUTCID_${ARG1}})
exten => s,7,Set(length=${LEN(${DIAL_OUT_${ARG1}})})
exten => s,8,Dial(${OUT_${ARG1}}/${ARG2:${length}})
exten => s,9,Playtones(congestion)
exten => s,10,Congestion(5)
exten => s,109,Macro(outisbusy)
; dialout using a trunk, using pattern matching (don't strip any prefix)
; arg1 = trunk number, arg2 = number, arg3 = route password
;
; MODIFIED (PL)
;
; Modified both Dial() commands to include the new TRUNK_OPTIONS
from the general
; screen of AMP
;
[macro-dialout-trunk]
exten => s,1,Set(DIAL_TRUNK=${ARG1})
51
; If NODEST is set, clear it. No point in remembering since dialout-
trunk will just end in the
; bit bucket. But if answered by an outside line with transfer
capability, we want NODEST to be
; clear so a subsequent transfer to an internal extension works and
goes to voicmail or other
; destinations.
;
exten => s,n,Set(_NODEST=)
52
exten => s,n,Goto(s-${DIALSTATUS},1)
exten =>
s,n(customtrunk),Set(pre_num=${CUT(OUT_${DIAL_TRUNK},$,1)})
exten => s,n,Set(the_num=${CUT(OUT_${DIAL_TRUNK},$,2)}) ; this is
where we expect to find string OUTNUM
exten => s,n,Set(post_num=${CUT(OUT_${DIAL_TRUNK},$,3)})
exten => s,n,GotoIf($["${the_num}" =
"OUTNUM"]?outnum:skipoutnum) ; if we didn't find "OUTNUM", then
skip to Dial
exten => s,n(outnum),Set(the_num=${OUTNUM}) ; replace "OUTNUM"
with the actual number to dial
exten =>
s,n(skipoutnum),Dial(${pre_num:4}${the_num}${post_num},300,${DIA
L_TRUNK_OPTIONS})
exten => s,n,Goto(s-${DIALSTATUS},1)
53
exten => s,1,Wait(1)
exten => s,2,Macro(user-callerid,SKIPTTL)
exten => s,3,Read(CALLBACKNUM,agent-user) ; get callback
number from user
exten => s,4,GotoIf($["${CALLBACKNUM}" = ""]?5:7) ; if user just
pressed # or timed out, use cidnum
exten => s,5,Set(CALLBACKNUM=${CALLERID(number)})
exten => s,6,GotoIf($["${CALLBACKNUM}" = ""]?2) ; if still no
number, start over
exten => s,7,GotoIf($["${ARG2}" = ""]?9:8) ; arg2 is queue
password
exten => s,8,Authenticate(${ARG2})
exten =>
s,9,AddQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-
internal/n) ; using chan_local allows us to have agents over
trunks
exten => s,10,UserEvent(Agentlogin|Agent: ${CALLBACKNUM})
exten => s,11,Wait(1)
exten => s,12,Playback(agent-loginok)
exten => s,13,Hangup()
54
; arg1 = trunk number, arg2 = number
[macro-dialout-enum]
; This has been violently beaten upon by Rob Thomas,
xrobau@gmail.com
; to 1: Be compliant with all the depreciated bits in asterisk 1.2 and
; above, and 2: to give a good shot at attempting to be compliant with
; RFC3761 by honouring the order in which records are returned.
exten => s,1,GotoIf($["${ARG3}" != ""]?PASSWD:NOPASSWD); arg3 is
pattern password
exten => s,n(PASSWD),Authenticate(${ARG3})
exten => s,n(NOPASSWD),Macro(user-callerid,SKIPTTL)
exten => s,n,Macro(record-enable,${CALLERID(number)},OUT)
exten => s,n,Macro(outbound-callerid,${ARG1})
exten => s,n,Set(GROUP()=OUT_${ARG1})
exten => s,n,GotoIf($[ ${GROUP_COUNT()} >
${OUTMAXCHANS_${ARG1}} ]?nochans)
exten => s,n,Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK=${ARG1})
exten => s,n,DeadAGI(fixlocalprefix) ; this sets DIAL_NUMBER to the
proper dial string for this trunk
exten => s,n,Set(E164NETWORKS=e164.arpa-e164.info-e164.org) ;
enum networks to check
exten => s,n,GotoIf($["${DIAL_NUMBER:0:1}" = "+"]?begin) ; Skip next
line if it already is prefixed by a plus
exten => s,n,Set(DIAL_NUMBER=+${DIAL_NUMBER}) ; Add a plus to
the start, becasue ENUMLOOKUP needs it.
exten =>
s,n,Set(ENUMCOUNT=${ENUMLOOKUP(${DIAL_NUMBER},all,c,${ENU
MNET})})
55
exten => s,n,Set(ENUMPTR=0)
exten => s,n,Set(LOOKUPBUG=0)
; OK. If we're here, we've still got some enum entries to go through.
Back to
; the start with you!
exten => s,n,Goto(startloop)
56
; The only workaround I can think of is when we hit an invalid entry,
do a
; DECREMENT of the pointer, and keep trying.
exten => s,n(enumbug),Set(ENUMPTR=$[${ENUMPTR}-1])
exten => s,n,NoOp(If this is looping with the same ENUM value, The
ENUMLOOKUP function is fixed!)
exten => s,n,Set(LOOKUPBUG=$[${LOOKUPBUG}+1])
; If we've done this more than, ooh, 5 times, then give up on this
network. Sorry.
exten => s,n,GotoIf($["${LOOKUPBUG}" > 5 ]?failed)
exten => s,n,Goto(continue)
; If it's IAX2...
exten => s,n(iaxuri),Set(DIALSTR=IAX2/${ENUM:5})
exten => s,n,Goto(dodial)
; Now, if we're still here, that means the Dial failed for some reason.
; If it's CONGESTION or CHANUNAVAIL we probably want to try again
on a
; different channel. However, if it's the last one, we don't have any
; left, and I didn't keep any previous dialstatuses, so hopefully
; someone looking throught the logs would have seen the NoOp's
exten =>
s,n,GotoIf($["${ENUMPTR}"<"${ENUMCOUNT}"]?maybemore:dialfailed)
exten => s,n(maybemore),GotoIf($[ $[ "${DIALSTATUS}" =
"CHANUNAVAIL" ] | $[ "${DIALSTATUS}" = "CONGESTION" ]
]?continue)
57
; If we're here, then it's BUSY or NOANSWER or something and well,
deal with it.
exten => s,n(dialfailed),Goto(s-${DIALSTATUS},1)
[macro-record-enable]
exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4)
exten => s,2,ResetCDR(w)
exten => s,3,StopMonitor()
; I haven't figured out how, but occasionally a hung up
; call can end up here. If you don't use DeadAGI (which does
; work fine as a normal AGI), asterisk deadlocks a thread,
; and ends up grumpy.
exten => s,4,DeadAGI(recordingcheck,${TIMESTAMP},${UNIQUEID})
exten => s,5,Noop(No recording needed)
exten => s,999,MixMonitor(${CALLFILENAME}.wav)
58
[macro-dumpvars]
exten => s,1,Noop(ACCOUNTCODE=${ACCOUNTCODE})
exten => s,2,Noop(ANSWEREDTIME=${ANSWEREDTIME})
exten => s,3,Noop(BLINDTRANSFER=${BLINDTRANSFER})
exten => s,4,Noop(CALLERID=${CALLERID(all)})
exten => s,5,Noop(CALLERID(name)=${CALLERID(name)})
exten => s,6,Noop(CALLERID(number)=${CALLERID(number)})
exten => s,7,Noop(CALLINGPRES=${CALLINGPRES})
exten => s,8,Noop(CHANNEL=${CHANNEL})
exten => s,9,Noop(CONTEXT=${CONTEXT})
exten => s,10,Noop(DATETIME=${DATETIME})
exten => s,11,Noop(DIALEDPEERNAME=${DIALEDPEERNAME})
exten => s,12,Noop(DIALEDPEERNUMBER=${DIALEDPEERNUMBER})
exten => s,13,Noop(DIALEDTIME=${DIALEDTIME})
exten => s,14,Noop(DIALSTATUS=${DIALSTATUS})
exten => s,15,Noop(DNID=${DNID})
exten => s,16,Noop(EPOCH=${EPOCH})
exten => s,17,Noop(EXTEN=${EXTEN})
exten => s,18,Noop(HANGUPCAUSE=${HANGUPCAUSE})
exten => s,19,Noop(INVALID_EXTEN=${INVALID_EXTEN})
exten => s,20,Noop(LANGUAGE=${LANGUAGE})
exten => s,21,Noop(MEETMESECS=${MEETMESECS})
exten => s,22,Noop(PRIORITY=${PRIORITY})
exten => s,23,Noop(RDNIS=${RDNIS})
exten => s,24,Noop(SIPDOMAIN=${SIPDOMAIN})
exten => s,25,Noop(SIP_CODEC=${SIP_CODEC})
exten => s,26,Noop(SIPCALLID=${SIPCALLID})
exten => s,27,Noop(SIPUSERAGENT=${SIPUSERAGENT})
exten => s,28,Noop(TIMESTAMP=${TIMESTAMP})
exten => s,29,Noop(TXTCIDNAME=${TXTCIDNAME})
exten => s,30,Noop(UNIQUEID=${UNIQUEID})
exten => s,31,Noop(TOUCH_MONITOR=${TOUCH_MONITOR})
exten => s,32,Noop(MACRO_CONTEXT=${MACRO_CONTEXT})
exten => s,33,Noop(MACRO_EXTEN=${MACRO_EXTEN})
exten => s,34,Noop(MACRO_PRIORITY=${MACRO_PRIORITY})
[macro-user-logon]
; check device type
exten =>
s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
59
exten => s,2,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
; get user's extension
exten => s,3,Set(AMPUSER=${ARG1})
exten => s,4,GotoIf($["${AMPUSER}" = ""]?5:9)
exten => s,5,BackGround(please-enter-your)
exten => s,6,Playback(extension)
exten => s,7,Read(AMPUSER,then-press-pound)
; get user's password and authenticate
exten => s,8,Wait(1)
exten =>
s,9,Set(AMPUSERPASS=${DB(AMPUSER/${AMPUSER}/password)})
exten => s,10,GotoIf($[${LEN(${AMPUSERPASS})} = 0]?s-
NOPASSWORD,1)
; do not continue if the user has already logged onto this device
exten =>
s,11,Set(DEVICEUSER=${DB(DEVICE/${CALLERID(number)}/user)})
exten => s,12,GotoIf($["${DEVICEUSER}" = "${AMPUSER}"]?s-
ALREADYLOGGEDON,1)
exten => s,13,Authenticate(${AMPUSERPASS})
; devices can only be mapped to one user - loggoff anyone else who is
here
exten => s,14,Macro(user-logoff)
; map user to device
exten =>
s,15,Set(AMPUSERDEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => s,16,GotoIf($[${LEN(${AMPUSERDEVICES})} = 0]?18)
exten => s,17,Set(AMPUSERDEVICES=${AMPUSERDEVICES}&)
exten =>
s,18,Set(AMPUSERDEVICES=${AMPUSERDEVICES}${CALLERID(num
ber)})
exten =>
s,19,Set(DB(AMPUSER/${AMPUSER}/device)=${AMPUSERDEVICES})
; map device to user
exten =>
s,20,Set(DB(DEVICE/${CALLERID(number)}/user)=${AMPUSER})
; create symlink from dummy device mailbox to user's mailbox
exten => s,21,System(/bin/ln -s
/var/spool/asterisk/voicemail/default/${AMPUSER}/
/var/spool/asterisk/voicemail/device/${CALLERID(number)})
60
exten => s-FIXED,1,NoOp(Device is FIXED and cannot be logged into)
exten => s-FIXED,2,Playback(ha/phone)
exten => s-FIXED,3,SayDigits(${CALLERID(number)})
exten => s-FIXED,4,Playback(is-curntly-unavail)
exten => s-FIXED,5,Playback(vm-goodbye)
exten => s-FIXED,6,Hangup ;TODO should play msg indicated device
cannot be logged into
[macro-user-logoff]
; check device type
exten =>
s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
exten => s,2,GotoIf($["${DEVICETYPE}" = "fixed"]?s-FIXED,1)
; remove entry from user's DEVICE key
; delete the symlink to user's voicemail box
exten => s,3,System(rm -f
/var/spool/asterisk/voicemail/device/${CALLERID(number)})
exten =>
s,4,Set(DEVAMPUSER=${DB(DEVICE/${CALLERID(number)}/user)})
exten =>
s,5,Set(AMPUSERDEVICES=${DB(AMPUSER/${DEVAMPUSER}/devic
e)})
exten => s,6,DeadAGI(list-item-
remove.php,${AMPUSERDEVICES},${CALLERID(number)},AMPUSERD
EVICES,&)
; reset user -> device mapping
61
; users can log onto multiple devices, need to just remove device from
value
exten =>
s,7,Set(DB(AMPUSER/${DEVAMPUSER}/device)=${AMPUSERDEVICE
S})
; reset device -> user mapping
exten => s,8,Set(DB(DEVICE/${CALLERID(number)}/user)=none)
exten => s,9,Playback(vm-goodbye)
[macro-systemrecording]
exten => s,1,Goto(${ARG1},1)
62
exten => t,n,Hangup
;
;
#########################################################
###################
; CallerID Handling
;
#########################################################
###################
63
exten => s,n(report2),Set(_TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} -
1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER}) ; wait for a while, to give it a chance
to be picked up by voicemail
exten => s,n,Answer()
exten => s,n,Wait(2)
exten => s,n,Playback(im-sorry&an-error-has-occured&with&call-
forwarding)
exten => s,n,Macro(hangupcall)
exten => s,n,Congestion()
exten => s,n(continue),NoOp(Using CallerID ${CALLERID(all)})
exten => h,1,Macro(hangupcall)
64
;
exten =>
s,n,GotoIf($["foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}" =
"foo"]?bypass:normcid)
exten =>
s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDN
UM}/outboundcid)})
exten =>
s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDN
UM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($["${EMERGENCYROUTE:1:2}" = ""]?trunkcid) ;
check EMERGENCY ROUTE
exten => s,n,GotoIf($["${EMERGENCYCID:1:2}" = ""]?trunkcid) ; empty
EMERGENCY CID, so default back to trunk
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID}) ; emergency cid
for device
exten => s,n,Goto(report)
exten => s,n(trunkcid),GotoIf($["${TRUNKOUTCID:1:2}" = ""]?usercid)
;check for CID override for trunk (global var)
exten => s,n,Set(CALLERID(all)=${TRUNKOUTCID})
exten => s,n(usercid),GotoIf($["${USEROUTCID:1:2}" = ""]?report) ;
check CID override for extension
exten => s,n,Set(CALLERID(all)=${USEROUTCID})
exten =>
s,n,GotoIf($["x${CALLERID(name)}"!="xhidden"]?report:hidecid) ; check
CID blocking for extension
exten => s,n(hidecid),SetCallerPres(prohib_passed_screen) ; Only
works with ISDN (T1/E1/BRI)
exten => s,n(report),NoOp(CallerID set to ${CALLERID(all)})
; Privacy Manager Macro makes sure that any calls that don't pass
the privacy manager are presented
; with congestion since there have been observed cases of the call
continuing if not stopped with a
; congestion, and this provides a slightly more friendly 'sorry' message
in case the user is
; legitamately trying to be cooperative.
;
65
; Note: the following options are configurable in privacy.conf:
;
; maxretries = 3 ; default value, number of retries before failing
; minlength = 10 ; default value, number of digits to be accepted as
valid CID
;
[macro-privacy-mgr]
exten => s,1,Set(KEEPCID=${CALLERID(num)})
exten =>
s,n,GotoIf($["foo${CALLERID(num):0:1}"="foo+"]?CIDTEST2:CIDTEST1)
exten =>
s,n(CIDTEST1),Set(TESTCID=${MATH(1+${CALLERID(num)})})
exten => s,n,Goto(TESTRESULT)
exten =>
s,n(CIDTEST2),Set(TESTCID=${MATH(1+${CALLERID(num):1})})
exten =>
s,n(TESTRESULT),GotoIf($["foo${TESTCID}"="foo"]?CLEARCID:PRIVM
GR)
exten => s,n(CLEARCID),Set(CALLERID(num)=)
exten => s,n(PRIVMGR),PrivacyManager()
exten => s,n,SetCallerPres(allowed_passed_screen); stop gap until
app_privacy.c clears unavailble bit
exten => s,PRIVMGR+101,Noop(STATUS: ${PRIVACYMGRSTATUS}
CID: ${CALLERID(num)} ${CALLERID(name)} CALLPRES:
${CALLLINGPRES})
exten => s,n,Playback(sorry-youre-having-problems)
exten => s,n,Playback(goodbye)
exten => s,n,Playtones(congestion)
exten => s,n,Congestion(5)
;
;
#########################################################
###################
; Inbound Contexts [from]
;
#########################################################
###################
66
[from-sip-external]
;give external sip users congestion and hangup
; Yes. This is _really_ meant to be _. - I know asterisk whinges about
it, but
; I do know what I'm doing. This is correct.
exten => _.,1,NoOp(Received incoming SIP connection from unknown
peer to ${EXTEN})
exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
exten => _.,n,Goto(s,1)
exten => s,1,Ringing
exten => s,n,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?from-
trunk,${DID},1)
exten => s,n,Set(TIMEOUT(absolute)=15)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,Playtones(congestion)
exten => s,n,Congestion(5)
exten => h,1,NoOp(Hangup)
exten => i,1,NoOp(Invalid)
exten => t,1,NoOp(Timeout)
[from-internal]
; applications are now mostly all found in from-internal-additional in
_custom.conf
include => parkedcalls
include => from-internal-custom
;allow phones to dial other extensions
include => ext-fax
;allow phones to access generated contexts
;
; MODIFIED (PL)
;
; Currently the include for findmefollow is being auto-generated before
ext-local which is the desired behavior.
; However, I haven't been able to do anything that I know of to force
this. We need to determine if it should
; be hardcoded into here to make sure it doesn't change with some
configuration. For now I will leave it out
; until we can discuss this.
67
;
include => from-internal-additional
include => ext-local-confirm
; This causes grief with '#' transfers, commenting out for the moment.
; include => bad-number
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)
;------------------------------------------------------------------------
; [bad-number]
;------------------------------------------------------------------------
; This is where all calls go that don't have any other destination
provided
;
;------------------------------------------------------------------------
[bad-number]
exten => _X.,1,Wait(1)
exten => _X.,n,Playback(silence/1&cannot-complete-as-dialed&check-
number-dial-again,noanswer)
exten => _X.,n,Wait(1)
exten => _X.,n,Congestion(20)
exten => _X.,n,Hangup()
[from-zaptel]
exten => _X.,1,Set(DID=${EXTEN})
exten => _X.,n,Goto(s,1)
exten => s,1,NoOp(Entering from-zaptel with DID == ${DID})
; Some trunks _require_ a RINGING be sent before an Answer.
exten => s,n,Ringing()
; If ($did == "") { $did = "s"; }
exten => s,n,Set(DID=${IF($["${DID}"= ""]?s:${DID})})
68
exten => s,n,NoOp(DID is now ${DID})
exten => s,n,GotoIf($["${CHANNEL:0:3}"="Zap"]?zapok:notzap)
exten => s,n(notzap),Goto(from-pstn,${DID},1)
; If there's no ext-did,s,1, that means there's not a no did/no cid
route. Hangup.
exten => s,n,Macro(hangup)
exten => s,n(zapok),NoOp(Is a Zaptel Channel)
exten => s,n,Set(CHAN=${CHANNEL:4})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})
exten => s,n,Macro(from-zaptel-${CHAN},${DID},1)
; If nothing there, then treat it as a DID
exten => s,n,NoOp(Returned from Macro from-zaptel-${CHAN})
exten => s,n,Goto(from-pstn,${DID},1)
exten => fax,1,Goto(ext-fax,in_fax,1)
; ##########################################
; ## Ring Groups with Confirmation macros ##
; ##########################################
; Used by followme and ringgroups
;------------------------------------------------------------------------
; [macro-dial-confirm]
;------------------------------------------------------------------------
; This has now been incorporated into dialparties. It still only works
with ringall
; and ringall-prim strategies. Have not investigated why it doesn't
work with
; hunt and memory hunt.
;
;------------------------------------------------------------------------
[macro-dial-confirm]
; This was written to make it easy to use macro-dial-confirm instead
of macro-dial in generated dialplans.
; This takes the same paramaters, with an additional paramater of the
ring group Number
; ARG1 is the timeout
; ARG2 is the DIAL_OPTIONS
; ARG3 is a list of xtns to call - 203-222-240-123123123#-211
; ARG4 is the ring group number
69
; This sets a unique value to indicate that the channel is ringing. This
is used for warning slow
; users that the call has already been picked up.
;
exten => s,1,Set(DB(RG/${ARG4}/${CHANNEL})=RINGING)
; delete the variable, if we are here, we are done trying to dial and it
may have been left around
;
exten => s,n,DBDel(RG/${RINGGROUP_INDEX}/${CHANNEL})
exten => s,n,Set(USE_CONFIRMATION=)
exten => s,n,Set(RINGGROUP_INDEX=)
;------------------------------------------------------------------------
;------------------------------------------------------------------------
; [macro-auto-confirm]
;------------------------------------------------------------------------
70
; This macro is called from ext-local-confirm to auto-confirm a call so
that other extensions
; are aware that the call has been answered.
;
;------------------------------------------------------------------------
[macro-auto-confirm]
exten => s,1,Set(__MACRO_RESULT=)
exten => s,n,DBDel(${BLKVM_OVERRIDE})
exten => s,n,DBDel(RG/${ARG1}/${UNIQCHAN})
;------------------------------------------------------------------------
; [macro-auto-blkvm]
;------------------------------------------------------------------------
; This macro is called for any extension dialed form a queue,
ringgroup
; or followme, so that the answering extension can clear the voicemail
block
; override allow subsequent transfers to properly operate.
;
;------------------------------------------------------------------------
[macro-auto-blkvm]
exten => s,1,Set(__MACRO_RESULT=)
exten => s,n,DBDel(${BLKVM_OVERRIDE})
;------------------------------------------------------------------------
; [ext-local-confirm]
;------------------------------------------------------------------------
; If call confirm is being used in a ringgroup, then calls that do not
require confirmation are sent
; to this extension instead of straight to the device.
;
; The sole purpose of sending them here is to make sure we run
Macro(auto-confirm) if this
; extension answers the line. This takes care of clearing the database
key that is used to inform
; other potential late comers that the extension has been answered by
someone else.
;
;------------------------------------------------------------------------
[ext-local-confirm]
71
exten => _LC-.,1,Noop(IN ext-local-confirm with - RT: ${RT}, RG_IDX:
${RG_IDX})
exten => _LC-.,n,dial(${DB(DEVICE/${EXTEN:3}/dial)},${RT},M(auto-
confirm^${RG_IDX})${DIAL_OPTIONS})
;------------------------------------------------------------------------
; [macro-confirm]
;------------------------------------------------------------------------
; CONTEXT: macro-confirm
; PURPOSE: added default message if none supplied
;
; Follom-Me and Ringgroups provide an option to supply a message to
be
; played as part of the confirmation. These changes have added a
default
; message if none is supplied.
;
;------------------------------------------------------------------------
[macro-confirm]
exten => s,1,Set(LOOPCOUNT=0)
exten => s,n,Noop(CALLCONFIRMCID: ${CALLCONFIRMCID})
; ARG1 is the announcement to play to tell the user that they've got a
call they need
; to confirm. Something along the lines of 'You have an incoming call.
Press 1 to accept, 9 to reject'
exten => s,n,Set(MSG1=${IF($["foo${ARG1}" !=
"foo"]?${ARG1}:"incoming-call-1-accept-2-decline")})
exten => s,n(start),Read(INPUT|${MSG1}|1||1|5)
72
; already been answered by someone else. If it has, send this call to
toolate
exten =>
s,n,GotoIf(${DB_EXISTS(RG/${ARG3}/${UNIQCHAN})}?check:toolate)
; We passed that test, so it means the call hasn't been answered. Has
this user pushed 1? If so,
; then go to OK.
exten => s,n(check),GotoIf($["${INPUT}"="1"]?ok)
; If they've pushed 9, then they definately don't want the call. Just
pretend there was no response
; and go to noanswer (or 2 since that will be default for asterisk)
exten => s,n,GotoIf($["${INPUT}"="9"]?noanswer)
exten => s,n,GotoIf($["${INPUT}"="2"]?noanswer)
exten => s,n,GotoIf($["${INPUT}"="3"]?playcid)
; If we're here, that means we've played it MORE than 5 times. Set
__MACRO_RESULT=ABORT, well, just
; coz, and goto fin, which is the last line, meaning it returns to the
previous Dial, and pretends as
; if nothing has happened.
exten => s,n(noanswer),Set(__MACRO_RESULT=ABORT)
exten => s,n,Goto(fin)
; If we're here, it's because the call was already accepted by someone
else.
73
exten => s,n(toolate),Set(MSG2=${IF($["foo${ARG2}" !=
"foo"]?${ARG2}:"incoming-call-no-longer-avail")})
exten => s,n,Playback(${MSG2})
exten => s,n,Goto(noanswer)
; If we made it here, it's because the call _WAS_ accepted, AND it's
still ringing. We delete the
; database entry (so that the DB_EXISTS line above will trigger a
'toolate' jump), and set the
; MACRO_RESULT variable to NOTHING. This is the magic string that
joins both legs of the call together
exten => s,n(ok),DBDel(RG/${ARG3}/${UNIQCHAN})
exten => s,n,DBDel(${BLKVM_OVERRIDE})
exten => s,n,Set(__MACRO_RESULT=)
; The end.
exten => s,n(fin),NoOp(Finished)
exten => h,1,Noop(Hangup Extension in macro-confirm)
exten => h,n,Macro(hangupcall)
;------------------------------------------------------------------------
;
#########################################################
###################
; Extension Contexts [ext]
;
#########################################################
###################
[ext-fax]
exten => s,1,Answer
exten => s,2,Goto(in_fax,1)
exten => in_fax,1,StopPlayTones
exten => in_fax,2,GotoIf($["${FAX_RX}" = "system"]?3:analog_fax,1)
exten => in_fax,3,Macro(faxreceive)
exten => in_fax,4,Hangup
exten => analog_fax,1,GotoIf($["${FAX_RX}" = "disabled"]?4:2) ;if fax is
disabled, just hang up
exten => analog_fax,2,Set(DIAL=${DB(DEVICE/${FAX_RX}/dial)});
74
exten => analog_fax,3,Dial(${DIAL},20,d)
exten => analog_fax,4,Hangup
;exten => out_fax,1,wait(7)
exten => out_fax,1,txfax(${TXFAX_NAME}|caller)
exten => out_fax,2,Hangup
exten => h,1,system(/var/lib/asterisk/bin/fax-process.pl --to
${EMAILADDR} --from ${FAX_RX_FROM} --subject "Fax from
${URIENCODE(${CALLERID(number)})}
${URIENCODE(${CALLERID(name)})}" --attachment
fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf
--file ${FAXFILE});
exten => h,2,Hangup()
[incoming]
exten => s,1,Echo ;for testing the connection
;exten => s,1,Playback,demo-thanks ;for playing a file
75
2.11 Lampiran Topologi jaringan VOIP server UNILA
76
77