perlbrew / PERL STANALONE


[root@ipbx ecentrix]# chmod +x /home/ecentrix
[root@ipbx ecentrix]# su – ecentrix
[ecentrix@ipbx ~]$  curl -L http://install.perlbrew.pl | bash
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
107  1074  107  1074    0     0    419      0  0:00:02  0:00:02 –:–:–  4837

## Download the latest perlbrew

## Installing perlbrew
perlbrew is installed: ~/perl5/perlbrew/bin/perlbrew

perlbrew root (~/perl5/perlbrew) is initialized.

Append the following piece of code to the end of your ~/.bash_profile and start a
new shell, perlbrew should be up and fully functional from there:

source ~/perl5/perlbrew/etc/bashrc

Simply run `perlbrew` for usage details.

Happy brewing!

## Installing patchperl

## Done.

[ecentrix@ipbx ~]$ echo “source ~/perl5/perlbrew/etc/bashrc” >> ~/.bashrc

[ecentrix@ipbx ~]$ source ~/.bashrc

[ecentrix@ipbx ~]$ perlbrew available
perl-5.21.2
perl-5.20.0
perl-5.18.2
perl-5.16.3
perl-5.14.4
perl-5.12.5
perl-5.10.1
perl-5.8.9
perl-5.6.2
perl5.005_04
perl5.004_05
perl5.003_07

[ecentrix@ipbx ~]$ perlbrew install-multiple perl-5.21.2 –both thread -Doptimize=’-O3′ –append=’-O3′
perlbrew install-multiple perl-5.18.2 –both thread -Doptimize=’-O3′ –append=’-O3′
perlbrew install-multiple perl-5.20.0 –both thread -Doptimize=’-O3′ –append=’-O3′

[ecentrix@ipbx ~]$ perlbrew list

[ecentrix@vcentos bin]$ perlbrew install-cpanm

/home/ecentrix/perl5/perlbrew/bin/cpanm already exists, are you sure to override ? [y/N] [N] y

cpanm is installed to

/home/ecentrix/perl5/perlbrew/bin/cpanm

cpanm –interactive -v Log::Dispatch::FileRotate
cpanm –interactive -v DBI
cpanm –interactive -v Data::UUID
cpanm –interactive -v Time::HiRes
cpanm –interactive -v threads
cpanm –interactive -v threads::shared
cpanm –interactive -v Device::Gsm::Sms
cpanm –interactive -v Device::Modem
cpanm –interactive -v UUID::Generator::PurePerl
cpanm –interactive -v Log::Log4perl
cpanm –interactive -v Device::Gsm::Pdu
cpanm –interactive -v Time::HiRes
cpanm –interactive -v threads::shared
cpanm –interactive -v feature
cpanm –interactive -v IO::Socket::INET
cpanm –interactive -v Log::Dispatch::FileRotate
cpanm –interactive -v DBD::mysql
cpanm –interactive -v Pod::Perldoc::ToMan
cpanm –interactive -v Device::SerialPort
cpanm –interactive -v File::Basename
cpanm –interactive -v UUID::Generator::PurePerl

OR

/home/ecentrix/perl5/perlbrew/perls/perl-5.21.2-thread-multi-O3/bin/perl -MCPAN -e ‘fforce install Log::Dispatch::FileRotate’

Thanks
Moses

IMPORT CSV TO MYSQL (LOAD INTO FILE)


mysql -umyuser -pmypass -Bs -e “LOAD DATA INFILE ‘/home/cdr/cdr01/cdr-2014-07.csv’ INTO TABLE asterisk_cdr.cdr FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘\”‘ LINES TERMINATED BY ‘\n'”

HOW TO SETTING QUEUE ASTERISK


extensions.conf

;01 => INB
exten => 01,1,GoSub(queue-status,${EXTEN},1(INBOUND))
;02 => OUTB
exten => 02,1,GoSub(queue-status,${EXTEN},1(OUTBOUND))

;03 => BREAK

exten => 03,1,GoSub(queue-status,${EXTEN},1(PAUSED))

;04 => LOGOUT
exten => 04,1,GoSub(queue-status,${EXTEN},1(LOGOUT))
[queue-status]
exten => _X.,1,Set(FIRST_STATUS=${ARG1})
exten => _X.,n,Set(CH=SIP/${CHANNEL(peername)})
exten => _X.,n,MYSQL(Connect connid localhost myuserdb mypass queue)
exten => _X.,n,MYSQL(Query resultid ${connid} select status from t_queue where channel=’${CH}’)
exten => _X.,n,MYSQL(Fetch foundrow ${resultid} status)
exten => _X.,n,MYSQL(clear ${resultid})
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,NoOp(RETURN_PROVIDER: ${status})
exten => _X.,n,GotoIf($[ "${status}" = "" ]?queue-add,${EXTEN},1:queue-${FIRST_STATUS},${EXTEN},1)

[queue-add]
exten => _X.,1,SET(CH=SIP/${CHANNEL(peername)})
exten => _X.,n,MYSQL(Connect connid localhost myuserdb mypass queue)
exten => _X.,n,MYSQL(Query resultid ${connid} insert into t_queue(channel,status) values (‘${CH}’,’${FIRST_STATUS}’))
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,AddQueueMember(sales,${CH})
exten => _X.,n,Playback(beep)
exten => _X.,n,Hangup()

[queue-INBOUND]
exten => _X.,1,SET(CH=SIP/${CHANNEL(peername)})
exten => _X.,n,MYSQL(Connect connid localhost myuserdb mypass queue)
exten => _X.,n,MYSQL(Query resultid ${connid} update t_queue set channel=’${CH}’,status=’INBOUND’ where channel=’${CH}’)
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,AddQueueMember(sales,${CH})
exten => _X.,n,Playback(beep)
exten => _X.,n,Hangup()

[queue-OUTBOUND]
exten => _X.,1,SET(CH=SIP/${CHANNEL(peername)})
exten => _X.,n,MYSQL(Connect connid localhost myuserdb mypass queue)
exten => _X.,n,MYSQL(Query resultid ${connid} update t_queue set status=’OUTBOUND’ where channel=’${CH}’)
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,RemoveQueueMember(sales,${CH})
exten => _X.,n,Playback(beep)
exten => _X.,n,Hangup()

[queue-PAUSED]
exten => _X.,1,SET(CH=SIP/${CHANNEL(peername)})
exten => _X.,n,MYSQL(Connect connid localhost myuserdb mypass queue)
exten => _X.,n,MYSQL(Query resultid ${connid} update t_queue set status=’PAUSED’ where channel=’${CH}’)
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,RemoveQueueMember(sales,${CH})
exten => _X.,n,Playback(beep)
exten => _X.,n,Hangup()

[queue-LOGOUT]
exten => _X.,1,SET(CH=SIP/${CHANNEL(peername)})
exten => _X.,n,MYSQL(Connect connid localhost myuserdb mypass queue)
exten => _X.,n,MYSQL(Query resultid ${connid} update t_queue set status=’LOGOUT’ where channel=’${CH}’)
exten => _X.,n,MYSQL(Disconnect ${connid})
exten => _X.,n,RemoveQueueMember(sales,${CH})
exten => _X.,n,Playback(beep)
exten => _X.,n,Hangup()

queues.conf

[queue_template](!)
musicclass=default ; play [default] music
strategy=fewestcalls ; use the Round Robin Memory strategy
joinempty=yes ; join the queue when no members available
leavewhenempty=no ; don’t leave the queue no members available
ringinuse=no ; don’t ring members when already InUse

[sales](queue_template)
; Sales queue

[support](queue_template)
; Support queue

DB

t_queue CREATE TABLE `t_queue` (
`channel` varchar(10) DEFAULT NULL,
`status` char(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

NOTIFY USER WHEN LOGIN SSH TO SERVER


NOTIFIKASI SSH KETIKA LOGIN KE SERVER

[root@InxDev01 ssh]# vim /etc/ssh/login-notify.sh
if [ "$PAM_TYPE" != "close_session" ]; then
host=”`hostname`”
subject=”SSH Login: $PAM_USER from $PAM_RHOST on $host”
logger $subject
fi
[root@InxDev01 ssh]# chmod +x  /etc/ssh/login-notify.sh
[root@InxDev01 ssh]# vim /etc/pam.d/sshd
Tambah baris
 
session optional pam_exec.so seteuid /etc/ssh/login-notify.sh
Jika sudah ok rubah menjadi
session required pam_exec.so seteuid /etc/ssh/login-notify.sh
CHANGE MODIFIED FILE
date -d “$(stat -c “%y” /etc/ssh/login-notify.sh)” “+%Y%m%d%H%M”
TANGGAL=`date -d “$(stat -c “%y” /etc/ssh/login-notify.sh)” “+%Y%m%d%H%M”`
touch -m -t ${TANGGAL} login-notify.sh

Asterisk Call Recording Monitor() vs MixMonitor()


MixMonitor : record percakapan pada saat bridge (answer)

Format :

MixMonitor(filename.ext,options,command)

Contoh :

exten => _nxxxxxx,1,Set(CALLFILENAME=/var/spool/asterisk/monitor/${CDR(accountcode)}-${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.wav)
exten => _nxxxxxx,n,MixMonitor(${CALLFILENAME},b,/usr/sbin/wav2mp3 ${CALLFILENAME} ${peeremail} ${EXTEN} ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.mp3)

lame -h -b 192 kop-006.wav moses.mp3?

lame -b 32 –resample 8 -a kop-006.wav kop-006.mp3

 

exten => _nxxxxxx,1,Set(CALLFILENAME=/var/spool/asterisk/monitor/${CDR(accountcode)}-${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => _nxxxxxx,n,Set(MONITOR_EXEC_ARGS=${peeremail} ${EXTEN} ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => _nxxxxxx,n,Set(MONITOR_EXEC=mymix)
exten => _nxxxxxx,n,Monitor(wav,${CALLFILENAME},m)

Monitor => mencreate 2 file in dan out dan akan digabung kedua file ketika hangup

UPGRADE FIRMWARE QUINTUM TENOR DX


UPGRADE FIRMWARE QUINTUM

put C:\DX-P108-09-21\dspcode.bin
put C:\DX-P108-09-21\DXDSPB.bin
put C:\DX-P108-09-21\tnrboot.bin
put C:\DX-P108-09-21\tnrsys.bin
put C:\DX-P108-09-21\tnrdx.jbc
put C:\DX-P108-09-21\ProgressToneCountry.xml
put C:\DX-P108-09-21\cli_error_msg.txt
put C:\DX-P108-09-21\cli_help_msg.txt
put C:\DX-P108-09-21\cli_obj_msglist.txt

Protected: VIRTUAL USER FTP CENTOS 6.4


This content is password protected. To view it please enter your password below:

shisdew

Listens until think alike

co.id.intelix

POWER CAN NOT BE GIVEN IT HAS TO BE TAKEN

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: