FREEPBX DEVICE AMPUSER


asterisk -rx “database show” | grep “AMPUSER” | grep “device” | awk ‘{print $1}’ | cut -d’/’ -f3,4 > AMPUSER

asterisk -rx “database show” | grep “DEVICE” | grep -w “user” | awk ‘{print $1}’ | cut -d’/’ -f3,4 > DEVICE

 

for i in `cat AMPUSER`; do
echo $i;
/usr/sbin/asterisk -rx “database del AMPUSER $i”
done
for i in `cat DEVICE`; do
echo $i;
/usr/sbin/asterisk -rx “database del DEVICE $i”
done

amportal restart

 

Continue reading

SFTP ONLY CHROOT


SFTPONLY
groupadd sftponly
useradd user2015
usermod -aG sftponly user2015
passwd user2015

vim /etc/ssh/sshd_config

Comment :

#Subsystem sftp /usr/libexec/openssh/sftp-server

Replace

Subsystem sftp internal-sftp

#Add di beris terakhir

Match Group sftponly
ChrootDirectory %h
ForceCommand internal-sftp
X11Forwarding no
AllowTcpForwarding no

sudo -u user2015 mkdir -pv /home/user2015/upload
chown root. /home/user2015
chmod 755 /home/user2015
chgrp -R sftponly /home/user2015

service sshd restart

#ACL
setfacl -R -m u:apache:rwx /home/user2015
setfacl -R -m g:apache:rwx /home/user2015

GOSUB ASTERISK RETURN()


exten => 02151300420,1,GoSub(dlpn-incoming,incall,1(SIP/mera8/${EXTEN}))

[dlpn-incoming]
exten => incall,1,Noop(INCOMING CALLL >> DIAL ${ARG1})
exten => incall,n,NoOp(DNID = ${CALLERID(dnid)})
exten => incall,n,NoOp(RDNIS = ${CALLERID(rdnis)})
exten => incall,n,NoOp(ANI = ${CALLERID(ani)})
exten => incall,n,NoOp(NUM = ${CALLERID(num)})
exten => incall,n,Dial(${ARG1},,tT)
exten => incall,n,Return()

OPUS WEBRTC


[root@opuscodec asterisk]# ldd /usr/sbin/asterisk | egrep ‘ssl|srtp’
libasteriskssl.so.1 => /usr/lib/libasteriskssl.so.1 (0x002c2000)
libssl.so.10 => /usr/lib/libssl.so.10 (0x00608000)

[root@opuscodec asterisk]# ls -l /usr/lib/asterisk/modules/res_srtp.so
-rwxr-xr-x. 1 root root 211832 May 14 21:48 /usr/lib/asterisk/modules/res_srtp.so

./ast_tls_cert -C “192.168.1.105” -O “opuscodec” -d /etc/asterisk/keys

sip.conf

[general]
context=public
allowoverlap=no
domainsasrealm=yes
udpbindaddr=0.0.0.0:5060
tcpenable=no                    ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0
srvlookup=yes
maxcallbitrate=384
domain=192.168.1.105
allowexternaldomains=yes
realm=192.168.1.105
udpbindaddr=192.168.1.105

[authentication]

 

[1007] ; This will be WebRTC client
type=friend
defaultuser=1007
host=dynamic ; Allows any host to register
secret=1007; The SIP Password for SIP.js
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=from-agents ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
videosupport=yes
encryption=yes

dtlsenable=yes
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass

disallow=all
allow=opus

srtpcapable=yes ; optional aja

 

[1006] ; This will be WebRTC client
type=friend
defaultuser=1006
host=dynamic ; Allows any host to register
secret=1006; The SIP Password for SIP.js
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=from-agents ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
videosupport=yes
encryption=yes

dtlsenable=yes
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass

disallow=all
allow=opus

srtpcapable=yes ; optional aja
extensions.conf

[general]
static = yes
writeprotect = no
autofallthrough = yes
clearglobalvars = no

[globals]

[from-agents]
exten => _X.,1,Set(_SIP_SRTP_SDES=1)
exten => _X.,n,Set(_SIPSRTP=1)
exten => _X.,n,Set(_SIPSRTP_CRYPTO=enable)
exten => _X.,n,Dial(SIP/${EXTEN},,tT)
exten => _X.,n,Hangup()

manager.conf

[general]
enabled = no
webenabled = yes

port = 5038
bindaddr = 0.0.0.0

http.conf ( for websocket) –> test via wscat

[general]
enabled=yes
bindaddr=0.0.0.0
bindport=8088

OPUS CODEC ASTERISK 13


opuscodec*CLI> core show translation
opus 15600 15600 15600 15600 15600    15600 15600  9600  9600  9600  9600 17500 17500  9000 17000 17000 15600 15600 15600 15600 23500 15600 15600   15600     –
opuscodec*CLI>

Mixmonitor tidak support jika menggunakan codec opus

Gunakan Monitor untuk me-record file recording (wav to mp3)

exten => _X.,n,Set(DIR=/var/www/html/recording/${STRFTIME(${EPOCH},,%Y/%m/%d)})
exten => _X.,n,System(/bin/mkdir -p ${DIR})
exten => _X.,n,Set(FILE_NAME=${EXT}-${NUMBER}-${STRFTIME(${EPOCH},,%H%M%s)})
exten => _X.,n,Set(FILE_REC=/var/www/html/recording/${STRFTIME(${EPOCH},,%Y/%m/%d)}/${FILE_NAME})
exten => _X.,n,Noop(${FILE_REC})
exten => _X.,n,Set(MONITOR_EXEC_ARGS=&& nice -n 19 /usr/bin/lame -V 1 “${FILE_REC}.wav” “${FILE_REC}.mp3” && /bin/rm -rf “${FILE_REC}.wav”)
exten => _X.,n,Monitor(wav,${FILE_REC},mb)
exten => _X.,n,Dial(SIP/sonus-mg/199962${EXTEN:1},,tT)
exten => _X.,n,NoOp(DIAL_STATUS=${DIALSTATUS}, HANGUP_CAUSE=${HANGUPCAUSE})
;exten => _X.,n,Hangup()

exten => h,1,Noop(${FILE_REC})
exten => h,n,Hangup()

Setting up SILK Codec with Asterisk 10/11


Wikipedia on SILK: http://en.wikipedia.org/wiki/SILK
This guide takes you through the setup of SILK codec with Asterisk 11. It also can be used to setup Asterisk 10.
While it should work for other environments, this particular guide was written for
1) Debian
2) Working Asterisk 11 (try this article if you want a how-to)
Why use Skype’s SILK?
Here’s the quick how-to (Parts of this guide was taken from Asterisk Wiki here )

  1. Download the  benchmark tool based on your processor architecture. In my case I am using 64 bit so I downloaded the x86_64. Browse to http://downloads.digium.com/pub/telephony/codec_silk/benchsilk/ for options. Copy the URL and do the wget like below
    # cd /usr/src
    # wget http://downloads.digium.com/pub/telephony/codec_silk/benchsilk/x86-64/benchsilk-1.0.0-x86_64
    # chmod +x bench*
    # ./benchsilk-1.0.0-x86_64
  2. After this you will see the recommendation made from the benchmarking tool. Since I was running a VM for writing this, my winner was “generic”, so I headed to this http://downloads.digium.com/pub/telephony/codec_silk/ link, selected my Asterisk version, and selected the processor architecture, which was x86_64, then copied the generic codec url to do wget with
    # wget http://downloads.digium.com/pub/telephony/codec_silk/asterisk-11.0/x86-64/codec_silk-11.0_1.0.0-generic_64.tar.gz
    # tar –zxvf codec_silk*
    # cd codec_silk-11.0_1.0.0-generic_64     (or whatever version of yours directory name)
    # cp codec* /usr/lib/asterisk/modules/
  3. Now put up some configs for codecs.conf
    # nano /etc/asterisk/codecs.conf         (create the file if don’t exist). Paste below all variations this codec
    [silk8]
    type=silk
    samprate=8000
    fec=true
    packetloss_percentage=10
    maxbitrate=20000
    dtx=false

    [silk12]
    type=silk
    samprate=12000
    fec=true
    packetloss_percentage=10
    maxbitrate=25000
    dtx=false

    [silk16]
    type=silk
    samprate=16000
    fec=true
    packetloss_percentage=10
    maxbitrate=30000
    dtx=false

    [silk24]
    type=silk
    samprate=24000
    fec=true
    packetloss_percentage=10
    maxbitrate=40000
    dtx=false

  4. Save and exit
  5. Load the codec
    # asterisk -rx “module load codec_silk.so”
    You should see it return as “Loaded….”
  6. Now, check the translations and codecs
    # asterisk –rx “core show translation”
    # asterisk –rx “core show codecs”
  7. Sometimes, you might need to start and stop asterisk for it to show up in the codec translation table (and for it to work)
  8. On both command executions, you should see in those outputs the words SILK8, SILK12, SILK16, SILK24
  9. Be sure to “allow” this codec for each of your extensions, or sip general settings
    And for each extension, be sure to setup like this
    disallow=all
    allow=silk8 ;;;or whatever silk band you fancy, I use the narrowband as its important to use smallest bandwidth
  10. Connect using phones that support SILK, set those phones to only use SILK in its list of codecs based on the frequency you’ve “allowed”, in the case above, 8Khz. Typically, 8Khz band will only use 5-20kbps 🙂
  11. Checkout this document on the payload. The codecs.conf gives you the ability to tweak for poor network conditions too like on Wifi roamers….

Phones that support SILK in my tests:

  1. CSIPSimple for Android Mobile
  2. Basically anything using the PJSIP stack (which has become my favorite softphone….), e.g. http://microsip.org.ua/

Lots other phone vendors also do support SILK but it will probably come slower: Anyway, the PJSIP MicroSIP, I was making calls clean and flawlessly over Wifi

 

Source http://highsecurity.blogspot.com/2013/02/setting-up-silk-codec-with-asterisk-1011.html

asterisk: error while loading shared libraries: libjansson.so.4: cannot open shared object file: No such file or directory


Issue

You install Asterisk 12 successfully but receive the following error when trying to launch asterisk:

asterisk: error while loading shared libraries: libjansson.so.4: cannot open shared object file: No such file or directory

Solution

Execute this

echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local.conf

and

/sbin/ldconfig

Cause

I’m not expert on this. Can anyone explain why this works? I’ll give you a link to your website in return.

Source http://www.danjourno.com/asterisk-libjansson-cannot-open-shared/

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

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