Category Archives: Virtualisasi

INTEL IPP CODEC G729 & G729 ON ELASTIX 2.5 64 BIT


[root@localhost]# vim /etc/redhat-release

Red Hat Enterprise Linux Server release 5.10
[root@localhost]# tar -zxvf l_ipp_7.0.6.293_intel64.tgz -C /usr/src/

[root@localhost]# cd /usr/src/l_ipp_7.0.6.293_intel64/

./install.sh

accept

1. I want to activate my product using a serial number [default]
2. I want to evaluate my product or activate later
3. I want to activate either remotely, or by using a license file, or by using a
license manager

h. Help
b. Back to the previous menu
q. Quit
——————————————————————————–
Please type a selection or press “Enter” to accept default choice [1]:
Note: Press “Enter” key to back to the previous menu.
Please type your serial number (the format is XXXX-XXXXXXXX): SERIAL_NUMBER

Step no: 4 of 6 | Options
——————————————————————————–
You are now ready to begin installation. You can use all default installation
settings by simply choosing the “Start installation Now” option or you can
customize these settings by selecting any of the change options given below
first. You can view a summary of the settings by selecting
“Show pre-install summary”.
——————————————————————————–
1. Start installation Now

2. Change install directory [ /opt/intel/composer_xe_2011_sp1.9.293 ]
3. Show pre-install summary

h. Help
b. Back to the previous menu
q. Quit
——————————————————————————–
Please type a selection or press “Enter” to accept default choice [1]:

ENTER
Step no: 6 of 6 | Complete
——————————————————————————–
Thank you for installing and for using the
Intel(R) Integrated Performance Primitives 7.0 Update 6 for Linux*.

Support services start from the time you install or activate your product, so
please create your support account now in order to take full advantage of your
product purchase. Your Subscription Service support account provides access to
free product updates interactive issue management, technical support, sample
code, and documentation.

To create your support account, please visit the Subscription Services web site
https://registrationcenter.intel.com/RegCenter/registerexpress.aspx?clientsn=XXXXXXX
——————————————————————————–
q. Quit [default]
——————————————————————————–
Please type a selection or press “Enter” to accept default choice [q]:
[root@localhost l_ipp_7.0.6.293_intel64]#

[root@localhost src]# wget http://asterisk.hosting.lv/src/asterisk-g72x-1.3.tar.bz2

[root@localhost src]# tar xvjf asterisk-g72x-1.3.tar.bz2 -C /usr/src/

[root@localhost src]# cd asterisk-g72x-1.3

[root@localhost asterisk-g72x-1.3]# ./autogen.sh
[root@localhost asterisk-g72x-1.3]# ./autogen.sh
aclocal:configure.ac:11: warning: macro `AM_PROG_LIBTOOL’ not found in library
configure.ac:10: error: possibly undefined macro: AC_DISABLE_STATIC
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:11: error: possibly undefined macro: AM_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1

[root@localhost asterisk-g72x-1.3]# yum remove libtool

[root@localhost asterisk-g72x-1.3]# cd /etc/yum.repos.d/

[root@localhost asterisk-g72x-1.3]# rm -rf REPO_ELASTIX

[root@localhost asterisk-g72x-1.3]# yum install libtool libtool-*

[root@localhost asterisk-g72x-1.3]# ./autogen.sh
[root@localhost asterisk-g72x-1.3]# ./configure –with-asterisk11 –with-ipp=/opt/intel/ipp –enable-opteron-sse3 && make && make install

DIGIT MANIPULATION WELLGATE FXS


digit_manipulation_wellgate01 digit_manipulation_wellgate02

RSYSLOG WELLGATE CDR


#$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
#$ModLoad imklog # provides kernel logging support (previously done by rklogd)
#$ModLoad immark # provides –MARK– message capability

# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
#### GLOBAL DIRECTIVES ####

# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

EXAMPLE CDR

Nov 13 11:38:44 2014-11-13 12: 39:13 CDR OUT Src :8023 Dst :922222081287264002 CallID 80be4168-cd0010ac-17bc-45026-7f-29658e35-7f START:2014/11/13 12:38:50 ANSWER:2014/11/13 12:39:03 END:2014/11/13 12:39:13 DURATION:023 BillSec:010 DISPOSITION:FINISHED

cdr_wellgate

:fromhost-ip,startswith,”172.16.0.205″ /var/log/remote.log

EVENT ASTERISK MANAGER


npm install asterisk-manager

/home/node_modules/asterisk-manager/lib/test.js

test.js

var ami = new require(‘asterisk-manager’)(‘5038′,’192.168.0.105′,’username’,’password’, true);

// Listen for any/all AMI events.
ami.on(‘managerevent’, function(evt) {
console.log(‘EVENT ::’, evt);

});

// Listen for specific AMI events. A list of event names can be found at
// https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Events
ami.on(‘hangup’, function(evt) {
console.log(‘HANGUP ::’, evt);
});
ami.on(‘confbridgejoin’, function(evt) {
console.log(‘CONFBRIDGEJOIN ::’, evt);
});

ami.on(‘close’, function(e) {
console.log(‘CLOSE ::’, e);
});
ami.on(‘disconnect’, function(e) {
console.log(‘DISCONNECT ::’, e);
});
ami.on(‘connect’, function(e) {
console.log(‘CONNECT ::’, e);
});

ami.action({
‘action’:’originate’,
‘channel’:’SIP/4001′,
‘context’:’default’,
‘exten’:1234,
‘priority’:1,
‘variables’:{
‘name1′:’value1’,
‘name2′:’value2’
}
}, function(err, res) {});

ASTERISK CEL 1.8


yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel

make menuselect -> CEL -> cel_odbc

make && make install && make config

service asterisk restart

ecentrix*CLI> module show like odbc
Module Description Use Count
res_odbc.so ODBC resource 0
res_config_odbc.so Realtime ODBC configuration 0
cdr_odbc.so ODBC CDR Backend 0
cdr_adaptive_odbc.so Adaptive ODBC CDR backend 0
func_odbc.so ODBC lookups 0
cel_odbc.so ODBC CEL backend 0
6 modules loaded

Create database “asteriskcdrdb”

CREATE TABLE IF NOT EXISTS `cel` (
  `id` int(11) NOT NULL auto_increment,
  `eventtype` varchar(30) NOT NULL,
  `eventtime` datetime NOT NULL,
  `cid_name` varchar(80) NOT NULL,
  `cid_num` varchar(80) NOT NULL,
  `cid_ani` varchar(80) NOT NULL,
  `cid_rdnis` varchar(80) NOT NULL,
  `cid_dnid` varchar(80) NOT NULL,
  `exten` varchar(80) NOT NULL,
  `context` varchar(80) NOT NULL,
  `channame` varchar(80) NOT NULL,
  `src` varchar(80) NOT NULL,
  `dst` varchar(80) NOT NULL,
  `channel` varchar(80) NOT NULL,
  `dstchannel` varchar(80) NOT NULL,
  `appname` varchar(80) NOT NULL,
  `appdata` varchar(80) NOT NULL,
  `amaflags` int(11) NOT NULL,
  `accountcode` varchar(20) NOT NULL,
  `uniqueid` varchar(32) NOT NULL,
  `linkedid` varchar(32) NOT NULL,
  `peer` varchar(80) NOT NULL,
  `userdeftype` varchar(255) NOT NULL,
  `eventextra` varchar(255) NOT NULL,
  `userfield` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `uniqueid_index` (`uniqueid`),
  KEY `linkedid_index` (`linkedid`)
);

vim /etc/odbc.ini

[mysql-odbc]
Description = ODBC to Mysql
Driver = MySQL
Database = asteriskcdrdb
Server = 127.0.0.1
UserName = userdb
Password = passdb
Socket = /var/lib/mysql/mysql.sock
option = 3

vim /etc/odbcinst.ini

[MySQL]
Description = ODBC for MySQL
Driver64 = /usr/lib64/libmyodbc5.so #--> 64 bit os
Setup64 = /usr/lib64/libodbcmyS.so # ---> 64 bit os
FileUsage = 1


[root@ecentrix asterisk-1.8.26.1]# cat /etc/asterisk/cel.conf | egrep 'enable|apps|events' 
enable=yes
apps=all
events=ALL
dateformat = %d-%m-%Y %T



[root@ecentrix asterisk-1.8.26.1]# cat /etc/asterisk/res_odbc.conf | egrep 'enabled|dsn|username|password|pooling|limit|pre-connect'
enabled => yes
dsn => mysql-odbc
username => dbuser
password => dbpass
pre-connect => yes
limit => 1
enabled => no


[root@ecentrix asterisk-1.8.26.1]# cat  /etc/asterisk/cel_odbc.conf
[cel]
connection=asterisk
table=cel
username=dbuser
password=dbpass
loguniqueid=yes

ecentrix*CLI> cel show status
CEL Logging: Enabled
CEL Tracking Event: ALL
CEL Tracking Event: CHAN_START
CEL Tracking Event: CHAN_END
CEL Tracking Event: HANGUP
CEL Tracking Event: ANSWER
CEL Tracking Event: APP_START
CEL Tracking Event: APP_END
CEL Tracking Event: BRIDGE_START
CEL Tracking Event: BRIDGE_END
CEL Tracking Event: CONF_START
CEL Tracking Event: CONF_END
CEL Tracking Event: PARK_START
CEL Tracking Event: PARK_END
CEL Tracking Event: BLINDTRANSFER
CEL Tracking Event: ATTENDEDTRANSFER
CEL Tracking Event: TRANSFER
CEL Tracking Event: HOOKFLASH
CEL Tracking Event: 3WAY_START
CEL Tracking Event: 3WAY_END
CEL Tracking Event: CONF_ENTER
CEL Tracking Event: CONF_EXIT
CEL Tracking Event: USER_DEFINED
CEL Tracking Event: LINKEDID_END
CEL Tracking Event: BRIDGE_UPDATE
CEL Tracking Event: PICKUP
CEL Tracking Event: FORWARD
CEL Tracking Application: all
CEL Event Subscriber: ODBC CEL backend
CEL Event Subscriber: CEL Custom CSV Logging
ecentrix*CLI> odbc show

ODBC DSN Settings
-----------------

 Name: asterisk
 DSN: mysql-odbc
 Last connection attempt: 1970-01-01 07:00:00
 Pooled: No
 Connected: Yes

[root@ecentrix asterisk-1.8.26.1]# odbcinst -s -q
[mysql-odbc]


[root@ecentrix asterisk-1.8.26.1]# odbcinst -j
unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

mysql> select * from cel;
+----+--------------+---------------------+----------+---------+---------+-----------+----------+-------+------------------+-------------------+-----+-----+---------+------------+---------+---------+----------+-------------+--------------+--------------+------+-------------+------------+-----------+
| id | eventtype | eventtime | cid_name | cid_num | cid_ani | cid_rdnis | cid_dnid | exten | context | channame | src | dst | channel | dstchannel | appname | appdata | amaflags | accountcode | uniqueid | linkedid | peer | userdeftype | eventextra | userfield |
+----+--------------+---------------------+----------+---------+---------+-----------+----------+-------+------------------+-------------------+-----+-----+---------+------------+---------+---------+----------+-------------+--------------+--------------+------+-------------+------------+-----------+
| 1 | CHAN_START | 2014-10-21 04:22:48 | 4001 | 4001 | | | | 3000 | from-agents | SIP/4001-00000000 | | | | | | | 3 | | 1413840168.0 | 1413840168.0 | | | | |
| 2 | ANSWER | 2014-10-21 04:22:48 | 4001 | 4001 | 4001 | | 3000 | 3000 | ecentrix-inbound | SIP/4001-00000000 | | | | | Answer | | 3 | | 1413840168.0 | 1413840168.0 | | | | |
| 3 | HANGUP | 2014-10-21 04:22:48 | 4001 | 4001 | 4001 | | 3000 | 3000 | ecentrix-inbound | SIP/4001-00000000 | | | | | | | 3 | | 1413840168.0 | 1413840168.0 | | | | |
| 4 | CHAN_END | 2014-10-21 04:22:48 | 4001 | 4001 | 4001 | | 3000 | 3000 | ecentrix-inbound | SIP/4001-00000000 | | | | | | | 3 | | 1413840168.0 | 1413840168.0 | | | | |
| 5 | LINKEDID_END | 2014-10-21 04:22:48 | 4001 | 4001 | 4001 | | 3000 | 3000 | ecentrix-inbound | SIP/4001-00000000 | | | | | | | 3 | | 1413840168.0 | 1413840168.0 | | | | |
+----+--------------+---------------------+----------+---------+---------+-----------+----------+-------+------------------+-------------------+-----+-----+---------+------------+---------+---------+----------+-------------+--------------+--------------+------+-------------+------------+-----------+
5 rows in set (0.00 sec)




Protected: FREESWITCH AND BILLING


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

agispeedy (The Agispeedy is an AGI Application Server implemention in asterisk and written by Pure PHP)


agispeedy

Donwload “agispeedy.jpg” rename to agispeedy.tar.gz then extract:)

/etc/init.d/agispeedy start

extensions.conf

[from-agents]

exten => 8888,1,Set(VAR_INPUT=1000)
exten => 8888,n,AGI(agi://127.0.0.1/demo,digits=12)
exten => 8888,n,Hangup()

[root@server66 ~]# php /agispeedy/bin/agispeedy.php –verbose

 

agi_demo.php

answer();
$agi->verbose(print_r($agi->param));

_number($agi,$agi->param);
_get_var($agi);
_input_digit($agi);

$agi->hangup();
return(true);
}

function _number($agi,$prm){
$agi->say_number($agi->param[‘digits’], $escape_digits=”);
}

function _get_var($agi){
$_gv=$agi->get_variable(‘VAR_INPUT’,$getvalue=TRUE);
$agi->verbose(“get_variable = “. $_gv);

}

function _input_digit($agi){
$_input=$agi->get_data(‘vm-tocancel’,$timeout=-1,$max_digits=2);
$agi->verbose(“_input_digit = “. $_input[‘result’]);

}
?>

 

agispeedy

PHP AGI FREEPBX/TRIBOX/ELASTIX


/var/lib/asterisk/agi-bin/PHP

-rwxr-xr-x 1 asterisk asterisk   233 Oct  6 12:19 moses.php

drwxr-xr-x 4 asterisk asterisk  4096 Oct  6 12:22 phpagi –> folder phpagi

[root@localhost asterisk]# vim extensions_additional.conf
[ext-test]
include => ext-test-custom

exten => 7777,1,Answer(1)
exten => 7777,n,AGI(/var/lib/asterisk/agi-bin/PHP/moses.php)

moses.php

#!/usr/bin/php -q
<?php
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));

set_time_limit(0);
ob_implicit_flush(false);
require(‘phpagi/phpagi.php’);

$agi = new AGI();
$agi->stream_file(“voucher_does_not_exist”);
$agi->hangup();
?>

ASERISK EXTENSION_STATE


[from-agents]

exten => 4003,hint,SIP/${EXTEN}
exten => 4002,hint,SIP/${EXTEN}
exten => 4001,hint,SIP/${EXTEN}
exten => _4X.,1,Set(EXT_STATE=${EXTENSION_STATE(${EXTEN}@from-agents)})

exten => _4X.,n,ExecIf($[ “${EXT_STATE}” == “NOT_INUSE” ]?Set(IN_USED=READY))

exten => _4X.,n,ExecIf($[ “${EXT_STATE}” == “INUSE” | “${EXT_STATE}” == “RINGING” | “${EXT_STATE}” == “INUSE&RINGING” | “${EXT_STATE}” == “BUSY” ]?Set(IN_USED=BUSY))

exten => _4X.,n,ExecIf($[ “${EXT_STATE}” == “UNAVAILABLE” | “${EXT_STATE}” == “UNKNOWN” ]?Set(IN_USED=UNAVAILABLE))
exten => _4X.,n,Noop(EXTENSION_STATUS=${IN_USED})

exten => _4X.,n(ok),Dial(SIP/${EXTEN},30,A(/var/lib/asterisk/sounds/vm-tmpexists)) –> play sound ketika di answer

exten => _4X.,n,Hangup()

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
shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY