Wednesday, July 24, 2013

Enable EYEBEAM CALL RECORDING by Default

Dial the following: ***7469
Filter for record

Find the line: system:general:auto_record_all_calls

Double click on the line and change this value 1. Next save these settings and restart eyebeam

General CLI commands for Asterisk, vicidial, goautodial

! - Execute a shell command
abort halt - Cancel a running halt
cdr status - Display the CDR status
feature show - Lists configured features
feature show channels - List status of feature channels
file convert - Convert audio file
group show channels - Display active channels with group(s)
help - Display help list, or specific help on a command
indication add - Add the given indication to the country
indication remove - Remove the given indication from the country
indication show - Display a list of all countries/indications
keys init - Initialize RSA key passcodes
keys show - Displays RSA key information
local show channels - List status of local channels
logger mute - Toggle logging output to a console
logger reload - Reopens the log files
logger rotate - Rotates and reopens the log files
logger show channels - List configured log channels
meetme - Execute a command on a conference or conferee
mixmonitor - Execute a MixMonitor command.
moh reload - Music On Hold
moh show classes - List MOH classes
moh show files - List MOH file-based classes
no debug channel (null)
originate - Originate a call
realtime load - Used to print out RealTime variables.
realtime update - Used to update RealTime variables.
restart gracefully - Restart Asterisk gracefully
restart now - Restart Asterisk immediately
restart when convenient - Restart Asterisk at empty call volume
sla show - Show status of Shared Line Appearances
soft hangup - Request a hangup on a given channel
stop gracefully - Gracefully shut down Asterisk
stop now - Shut down Asterisk immediately
stop when convenient - Shut down Asterisk at empty call volume
stun debug - Enable STUN debugging
stun debug off - Disable STUN debugging
udptl debug - Enable UDPTL debugging
udptl debug ip - Enable UDPTL debugging on IP
udptl debug off - Disable UDPTL debugging



AEL commands

ael debug contexts - Enable AEL contexts debug (does nothing)
ael debug macros - Enable AEL macros debug (does nothing)
ael debug read - Enable AEL read debug (does nothing)
ael debug tokens - Enable AEL tokens debug (does nothing)
ael nodebug - Disable AEL debug messages
ael reload - Reload AEL configuration



Agents commands

agent logoff - Sets an agent offline
agent show - Show status of agents
agent show online - Show all online agents



AGI commands

agi debug - Enable AGI debugging
agi debug off - Disable AGI debugging
agi dumphtml - Dumps a list of agi commands in html format
agi show- List AGI commands or specific help
dnsmgr reload - Reloads the DNS manager configuration
dnsmgr status - Display the DNS manager status
http show status - Display HTTP server status



Console commands

console active - Sets/displays active console
console answer - Answer an incoming console call
console autoanswer - Sets/displays autoanswer
console boost - Sets/displays mic boost in dB
console dial - Dial an extension on the console
console flash - Flash a call on the console
console hangup - Hangup a call on the console
console mute - Disable mic input
console send text - Send text to the remote device
console transfer - Transfer a call to a different extension
console unmute - Enable mic input



Core related commands

core clear profile - Clear profiling info
core set debug channel - Enable/disable debugging on a channel
core set debug - Set level of debug chattiness
core set debug off - Turns off debug chattiness
core set global - Set global dialplan variable
core set verbose - Set level of verboseness
core show applications - Shows registered dialplan applications
core show application - Describe a specific dialplan application
core show audio codecs - Displays a list of audio codecs
core show channels - Display information on channels
core show channel - Display information on a specific channel
core show channeltypes - List available channel types
core show channeltype - Give more details on that channel type
core show codecs - Displays a list of codecs
core show codec - Shows a specific codec
core show config mappings - Display config mappings (file names to config engines)
core show file formats - Displays file formats
core show file version - List versions of files used to build Asterisk
core show functions - Shows registered dialplan functions
core show function - Describe a specific dialplan function
core show globals - Show global dialplan variables
core show hints - Show dialplan hints
core show image codecs - Displays a list of image codecs
core show image formats - Displays image formats
core show license - Show the license(s) for this copy of Asterisk
core show profile - Display profiling info
core show switches - Show alternative switches
core show threads - Show running threads
core show translation - Display translation matrix
core show uptime - Show uptime information
core show version - Display version info
core show video codecs - Displays a list of video codecs
core show warranty - Show the warranty (if any) for this copy of Asterisk



Database commands

database del - Removes database key/value
database deltree - Removes database keytree/values
database get - Gets database value
database put - Adds/updates database value
database show - Shows database contents
database showkey - Shows database contents



Dialplan commands

dialplan add extension - Add new extension into context
dialplan add ignorepat - Add new ignore pattern
dialplan add include - Include context in other context
dialplan reload - Reload extensions and *only* extensions
dialplan remove extension - Remove a specified extension
dialplan remove ignorepat - Remove ignore pattern from context
dialplan remove include - Remove a specified include from context
dialplan save - Save dialplan
dialplan show - Show dialplan



DUNDI commands

dundi debug - Enable DUNDi debugging
dundi flush - Flush DUNDi cache
dundi lookup - Lookup a number in DUNDi
dundi no debug - Disable DUNDi debugging
dundi no store history - Disable DUNDi historic records
dundi precache - Precache a number in DUNDi
dundi query - Query a DUNDi EID
dundi show entityid - Display Global Entity ID
dundi show mappings - Show DUNDi mappings
dundi show peers - Show defined DUNDi peers
dundi show peer - Show info on a specific DUNDi peer
dundi show precache - Show DUNDi precache
dundi show requests - Show DUNDi requests
dundi show trans - Show active DUNDi transactions
dundi store history - Enable DUNDi historic records



GTalk & Jabber commands

gtalk reload - Enable Jabber debugging
gtalk show channels - Show GoogleTalk Channels
jabber debug - Enable Jabber debugging
jabber debug off - Disable Jabber debug
jabber reload - Enable Jabber debugging
jabber show connected - Show state of clients and components
jabber test - Shows roster, but is generally used for mog's debugging.



IAX2 commands

iax2 provision - Provision an IAX device
iax2 prune realtime - Prune a cached realtime lookup
iax2 reload - Reload IAX configuration
iax2 set debug - Enable IAX debugging
iax2 set debug jb - Enable IAX jitterbuffer debugging
iax2 set debug jb off - Disable IAX jitterbuffer debugging
iax2 set debug off - Disable IAX debugging
iax2 set debug trunk - Enable IAX trunk debugging
iax2 set debug trunk off - Disable IAX trunk debugging
iax2 show cache - Display IAX cached dialplan
iax2 show channels - List active IAX channels
iax2 show firmware - List available IAX firmwares
iax2 show netstats - List active IAX channel netstats
iax2 show peers - List defined IAX peers
iax2 show peer - Show details on specific IAX peer
iax2 show provisioning - Display iax provisioning
iax2 show registry - Display IAX registration status
iax2 show stats - Display IAX statistics
iax2 show threads - Display IAX helper thread info
iax2 show users - List defined IAX users
iax2 test losspct - Set IAX2 incoming frame loss percentage



Manager commands

manager show command - Show a manager interface command
manager show commands - List manager interface commands
manager show connected - List connected manager interface users
manager show eventq - List manager interface queued events
manager show users - List configured manager users
manager show user - Display information on a specific manager user



MGCP commands

mgcp audit endpoint - Audit specified MGCP endpoint
mgcp reload - Reload MGCP configuration
mgcp set debug - Enable MGCP debugging
mgcp set debug off - Disable MGCP debugging
mgcp show endpoints - List defined MGCP endpoints



Module management

module load - Load a module by name
module reload - Reload configuration
module show - List modules and info
module show like - List modules and info
module unload - Unload a module by name



PRI commands

pri debug span - Enables PRI debugging on a span
pri intense debug span - Enables REALLY INTENSE PRI debugging
pri no debug span - Disables PRI debugging on a span
pri set debug file - Sends PRI debug output to the specified file
pri show debug - Displays current PRI debug settings
pri show spans - Displays PRI Information
pri show span - Displays PRI Information
pri unset debug file - Ends PRI debug output to file



Queue commands

queue add member - Add a channel to a specified queue
queue remove member - Removes a channel from a specified queue
queue show - Show status of a specified queue
rtcp debug ip - Enable RTCP debugging on IP
rtcp debug - Enable RTCP debugging
rtcp debug off - Disable RTCP debugging
rtcp stats - Enable RTCP stats
rtcp stats off - Disable RTCP stats
rtp debug ip - Enable RTP debugging on IP
rtp debug - Enable RTP debugging
rtp debug off - Disable RTP debugging
say load - Set/show the say mode
show parkedcalls - Lists parked calls
show queue - Show information for target queue
show queues - Show the queues



SIP commands

sip history - Enable SIP history
sip history off - Disable SIP history
sip notify - Send a notify packet to a SIP peer
sip prune realtime - Prune cached Realtime object(s)
sip prune realtime peer - Prune cached Realtime peer(s)
sip prune realtime user - Prune cached Realtime user(s)
sip reload - Reload SIP configuration
sip set debug - Enable SIP debugging
sip set debug ip - Enable SIP debugging on IP
sip set debug off - Disable SIP debugging
sip set debug peer - Enable SIP debugging on Peername
sip show channels - List active SIP channels
sip show channel - Show detailed SIP channel info
sip show domains - List our local SIP domains.
sip show history - Show SIP dialog history
sip show inuse - List all inuse/limits
sip show objects - List all SIP object allocations
sip show peers - List defined SIP peers
sip show peer - Show details on specific SIP peer
sip show registry - List SIP registration status
sip show settings - Show SIP global settings
sip show subscriptions - List active SIP subscriptions
sip show users - List defined SIP users
sip show user - Show details on specific SIP user



Skinny commands

skinny reset - Reset Skinny device(s)
skinny set debug - Enable Skinny debugging
skinny set debug off - Disable Skinny debugging
skinny show devices - List defined Skinny devices
skinny show lines - List defined Skinny lines per device



Voicemail commands

voicemail show users - List defined voicemail boxes
voicemail show users for - List defined voicemail boxes for target context
voicemail show zones - List zone message formats



Zaptel commands

zap destroy channel - Destroys a channel
zap restart - Fully restart zaptel channels
zap show cadences - List cadences
zap show channels - Show active zapata channels
zap show channel - Show information on a channel
zap show status - Show all Zaptel cards status

Friday, July 12, 2013

Semd Voicemail to email using gmail

Voicemail to email using gmail and postfix



1. Remove the sendmail
yum remove sendmail or apt-get remove sendmail

2. Install postfix
yum install postfix or apt-get install postfix

3.script to configure the gmail for the postfix
wget http://www.lolacolay.com/ramon/postfixgmail.sh
chmod +x postfixgmail.sh
./postfixgmail.sh

it will ask your gmail usrname and password
note: u need to enter username@gmail.com

if you face any problem in downloading ,create a file as postfixgmail.sh and copy and paste the below script
actual script postfixgmail.sh

#/bin/bash!
#Input Gmail credentials
echo "Insert your Gmail user with syntax account@gmail.com"
read gmailuser
echo "Insert your Gmail password"
read gmailpasswd

# Input certificate data
echo "Now you need to input some data to create ssl certificates"
echo "=========================================================="
echo "Country code (two letter code like US, ES, CO, etc.):"
read country
echo "State:"
read state
echo "City:"
read locality
echo "Organization:"
read organization
echo "Oranizational Unit:"
read ogrunit
echo "Server Name:"
read servername
echo "Admin email:"
read adminemail

#Stop postfix, backup main.cf and add tls data
/etc/init.d/postfix stop
cp /etc/postfix/main.cf /etc/postfix/main.cf.backup-`date +%Y-%m-%d-%Hh%Mm`

cat >> /etc/postfix/main.cf << EOF # SMTP relayhost relayhost = [smtp.gmail.com]:587 ## TLS Settings smtp_tls_loglevel = 1 smtp_tls_CAfile = /etc/postfix/certs/CAcert.pem smtp_tls_cert_file = /etc/postfix/certs/mycert.pem smtp_tls_key_file = /etc/postfix/certs/mykey.pem smtp_use_tls = yes smtpd_tls_CAfile = /etc/postfix/certs/CAcert.pem smtpd_tls_cert_file = /etc/postfix/certs/mycert.pem smtpd_tls_key_file = /etc/postfix/certs/mykey.pem smtpd_tls_received_header = yes smtpd_use_tls = yes # configuracion tls smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous # alias de mapeo interno a externo smtp_generic_maps = hash:/etc/postfix/generic EOF #Configure postfix mv /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.backup-`date +%Y-%m-%d-%Hh%Mm` echo "[smtp.gmail.com]:587 $gmailuser:$gmailpasswd" >> /etc/postfix/sasl_passwd
mv /etc/postfix/generic /etc/postfix/generic.backup-`date +%Y-%m-%d-%Hh%Mm`
gmailaccount=`echo $gmailuser|awk -F "@" '1 { print $1 }'`
echo "$gmailaccount@localhost $gmailuser" >> /etc/postfix/generic
chmod 600 /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/generic
postmap /etc/postfix/sasl_passwd
postmap /etc/postfix/generic
/etc/init.d/postfix restart

#Backup ssl certificates and recreate them
mv /etc/postfix/certs /etc/postfix/certs.backup-`date +%Y-%m-%d-%Hh%Mm`
mkdir -p /etc/postfix/certs/
cd /etc/postfix/certs/

cat >> openssl.cnf << EOF [ req ] default_bits = 1024 # Size of keys default_keyfile = key.pem # name of generated keys default_md = md5 # message digest algorithm string_mask = nombstr # permitted characters distinguished_name = req_distinguished_name [ req_distinguished_name ] # Variable name Prompt string 0.organizationName = Organization Name (company) organizationalUnitName = Organizational Unit Name (department, division) emailAddress = Email Address emailAddress_max = 40 localityName = Locality Name (city, district) stateOrProvinceName = State or Province Name (full name) countryName = Country Name (2 letter code) countryName_min = 2 countryName_max = 2 commonName = Common Name (hostname, IP, or your name) commonName_max = 64 #-------------------Edit this section------------------------------ countryName_default = $country stateOrProvinceName_default = $state localityName_default = $locality 0.organizationName_default = $organization organizationalUnitName_default = $ogrunit commonName_default = $servername emailAddress_default = $adminemail EOF openssl dsaparam 1024 -out dsa1024.pem openssl req -x509 -nodes -days 3650 -newkey dsa:dsa1024.pem -out mycert.pem -keyout mykey.pem -config openssl.cnf -batch ln -s mycert.pem CAcert.pem openssl req -x509 -new -days 3650 -key mykey.pem -out mycert.pem -config openssl.cnf -batch rm -rf dsa1024.pem openssl.cnf # Uncomment the following line to send a test mail to $adminemail and view the maillog. Exit with CRTL+C # echo "this is a test email body to be sent" | mail -s "test email subject" $adminemail ; tail -f /var/log/maillog

Multiple carriers

Multiple Carriers in Asterisk
or Utilizing all the TRUNK's randomly

Below Dialplan will Dial the number randomly on the assigned Carriers

[general]
TRUNKA=SIP/voiptrunk
TRUNKB=SIP/clickdial
TRUNKC=DAHDI/g0


exten => _9044X.,1,Answer
exten => _9044X.,n,Set(Trunk=${RAND(1|3)})
exten => _9044X.,n,GoToIf($[${Trunk} = 1]?trunkA)
exten => _9044X.,n,GoToIf($[${Trunk} = 2]?trunkB)
exten => _9044X.,n,GoToIf($[${Trunk} = 3]?trunkC)
exten => _9044X.,n,Hangup
exten => _9044X.,n(trunkA),Dial(${TRUNKA}/${EXTEN:4},,tToR)
exten => _9044X.,n(trunkB),Dial(${TRUNKB}/${EXTEN:4},,tToR)
exten => _9044X.,n(trunkC),Dial(${TRUNKC}/${EXTEN:4},,tToR)
exten => _9044X.,n,Hangup

Install Fail2ban in Asterisk (Centos)

Installing Fail2ban in centos
1.yum install fail2ban
If your CentOS doesn't find the package, please execute the following command and then try again.
2.rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
3.yum install python iptables
or
wget http://downloads.sourceforge.net/project/fail2ban/fail2ban-stable/fail2ban-0.8.4/fail2ban-0.8.4.tar.bz2?use_mirror=transact

tar -xf fail2ban-0.8.4.tar.bz2
cd fail2ban-0.8.4
python setup.py install
cp files/redhat-initd /etc/init.d/fail2ban
chkconfig --add fail2ban
chkconfig fail2ban on

Once installing the Fail2ban  create asteirsk.conf file under the fail2ban directory

4.  vi /etc/fail2ban/filter.d/asterisk.conf

and copy and paste the below

# ===================
# /etc/fail2ban/filter.d/asterisk.conf
# Fail2Ban configuration file
#
#
# $Revision: 250 $
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# common.local
#before = common.conf
[Definition]
#_daemon = asterisk
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile.
#The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias
#for
# (?:::f{4,6}:)?(?PS+)
# Values: TEXT
#

failregex = Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Wrong password
            Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - No matching peer found
            Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Device does not match ACL
            Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Username/auth name mismatch
            Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Peer is not supposed to register
            NOTICE.* <HOST> failed to authenticate as '.*'$
            NOTICE.* .*: No registration for peer '.*' (from <HOST>)
            NOTICE.* .*: Host <HOST> failed MD5 authentication for '.*' (.*)
            VERBOSE.* logger.c: -- .*IP/<HOST>-.* Playing 'ss-noservice' (language '.*')


# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
# ===================
Add the [asterisk-iptables] section to your /etc/fail2ban/jail.conf file :
# /etc/fail2ban/jail.conf
#====================



5 .  Save and exit the file
6.   vi /etc/fail2ban/jail.conf
      go to the last line of theis file and paste the below lines there

[asterisk-iptables]
enabled = true
filter = asterisk
action = iptables-allports[name=ASTERISK, protocol=all]
sendmail-whois[name=ASTERISK,
dest=youremailaddress@somewhere.com, sender=fail2ban@somewhere.com]
logpath = /var/log/asterisk/full
maxretry = 5
bantime = 600
#====================


7. Also in /etc/fail2ban/jail.conf file you want to add your own IP address range ( ours is192.168.1.0 ) :
ignoreip = 127.0.0.1 192.168.1.0/24

8.  make the fail2ban to start at startup
     chkconfig fail2ban on
9.  start the fail2ban now
    /etc/init.d/fail2ban start
10 . now check whether the fail2ban is installed properly to detect the attacks
       iptables -L –v
      You should see "fail2ban-ASTERISK" in your iptables output.

11. now try to register a extension from outside with wrong password or worng extension and run the iptables command to see the blocked ip addresses

automatic Blocking Hackers ip who access ssh

Automatically Blocking the hackers ip who access the server via ssh with wrong password
using IPtables


Dependencies
1.Iptables
2.postfix/sendmail ( for email alert)


step 1

1.login to your server via ssh
2. go to cd /usr/src/
3. vi scan-secure.sh
4. copy and paste the below script there
#!/bin/sh

# scan /var/log/secure for ssh attempts
# use iptables to block the bad guys

# Looking for attempts on existing and non-existing users. For example:
# Nov 2 22:44:07 pbxer sshd[28318]: Failed password for root from 74.143.42.70 port 52416 ssh2
# Nov 3 00:06:57 pbxer sshd[31767]: Failed password for invalid user mat3 from 192.203.145.200 port 35841 ssh2

tail -1000 /var/log/secure | awk '/sshd/ && /Failed password for/ { if (/invalid user/) try[$13]++; else try[$11]++; }
END { for (h in try) if (try[h] > 4) print h; }' |
while read ip
do
# note: check if IP is already blocked...
/sbin/iptables -L -n | grep $ip > /dev/null
if [ $? -eq 0 ] ; then
# echo "already denied ip: [$ip]" ;
true
else
echo "Subject: denying ip: $ip" | /usr/sbin/sendmail urmailid@gmail.com
logger -p authpriv.notice "*** Blocking SSH attempt from: $ip"
/sbin/iptables -I INPUT -s $ip -j DROP
fi
done

5. type chmod 755 /usr/src/scan-secure.sh
6. make entry in the cron to run in every one or two minutes
crontab -e
* * * * * /usr/src/scan-secure.sh
7. now start the iptables
/etc/init.d/iptables restart


to check for the blocked hackers ip
type iptables -L -n

Free G729 codec for asterisk, vicidial, goautodial

Installing Free g729 codec in asterisk

1. Download the appropriate codec from the below link
    http://asterisk.hosting.lv/

Check your asterisk version  --  asterisk -rx "core show version"
check whether 32bit or 64 bit ---  uname -a

For asterisk 1.4 version and 32 bit Pentium based server (like intel xeon ,p4, dualcore core2duo0
http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-pentium4.so
For asterisk 1.4 and 64bit os (intel xeon all pentium )
http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-x86_64-pentium4.so
For asterisk 1.4 AMD athlon machines
http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-athlon-sse.so

in linux type
cd /usr/lib/asterisk/modules
wget http://asterisk.hosting.lv/bin/codec_g729-ast14-gcc4-glibc-pentium4.so
mv codec_g729-ast14-gcc4-glibc-pentium4.so codec_g729.so
chmod +x codec_g729.so
asterisk  -vvvvr
>module load codec_g729.so

now check whether the codec is loaded or not
>show translation
output's

g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722
     g723    -   -    -    -        -     -    -     -    -     -    -    -    -
      gsm    -   -    2    2        2     2    1     2    4     -    -    2    -
     ulaw    -   2    -    1        2     2    1     2    4     -    -    2    -
     alaw    -   2    1    -        2     2    1     2    4     -    -    2    -
 g726aal2    -   2    2    2        -     2    1     2    4     -    -    2    -
    adpcm    -   2    2    2        2     -    1     2    4     -    -    2    -
     slin    -   1    1    1        1     1    -     1    3     -    -    1    -
    lpc10    -   2    2    2        2     2    1     -    4     -    -    2    -
     g729    -   2    2    2        2     2    1     2    -     -    -    2    -

Configuring Digium cards with Asterisk , goautodial , vicidial , vicidialnow , freepbx

How to configure the Digium PRI cards in Asterisk or vicidial or Goautodial or vicidialnow or Freepbx
  • If you are using the precompiled iso of asteirsk software like ( trixbox , elastix , pbxinaflash , goautodial , vicibox,)  then the Dhadi driver will be by default installed , if not you need to install the dahdi driver manually.(installation of dahdi explained at last of this doc)
steps to configure the Digium cards
  • First you need to check whether card is in E1 or T1 mode.
  • Take card outside and check for the E1/T1 changeover jumper in the card, if your PRI line is E1 then you need close the jumper , if T1 then it should be open. then insert the card into the server.
  • Access your asterisk server via  ssh  , putty will be good tool to connect the server remotely via ssh
  • First you need to check whether the card is  recognised   by the your server 
  1.  type  lspci  this will output pci boards connected in the server , if digium card is  recognised   it  shows output as below     0e:08.0 Ethernet controller: Digium, Inc. Wildcard TE121 single-span T1/E1/J1 card (PCI-Express) (rev 11)    

  • Once the card is  recognised , follow the below steps

  1. type  dahdi_genconf  -vvvvvvv    -this will auto install configure the digium card  driver and conf files

  • [root@localhost ~]# dahdi_genconf -vvvvvv
  • Default parameters from /etc/dahdi/genconf_parameters
  • Generating /etc/dahdi/system.conf
  • Generating /etc/asterisk/dahdi-channels.conf
2. Type  dahdi_cfg  -vvvv     - this outputs the channels if it configured properly


[root@mrlpriprimary ~]# dahdi_cfg -vvvv
DAHDI Tools Version - 2.4.1
DAHDI Version: 2.4.1.2
Echo Canceller(s): MG2
Configuration
======================
SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
31 channels to configure.
Channel 01: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 01)
Channel 02: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 02)
Channel 03: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 03)
...........................................................................................................
Channel 30: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 30)
Channel 31: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 31)
3. Now configuration is done, some small changes to be done to enable the channels in the asterisk

  •    go to   vi  /etc/asterisk/chan_dahdi.conf
  •    go to last line of the file by pressing shift+g
  •    then add this line    #include dahdi-channels.conf
  •     save and exit the file.
4. Now go to asterisk cli  and type module reload chand_dahdi.so   or restart the server.
5. if the PRI line is up you can see green lights on the card.
6. if it shows RED light then either your pri is down or the pri cable not connected properly.
7. by default the digium cards configured with group 0 or 11 , so in your dialplan you need to mention g0
8. so you need write dialplan as 
    exten => _X.,Dial(DAHDI/g0/${EXTEN},,)
   "if goautodial/vicidial/vicibox  use the below dialplan in carrier or custome dialplan"
    exten => _9XXXXX.,1,AGI(agi://127.0.0.1:4577/call_log)
    exten => _9XXXXX.,2,Dial(DAHDI/g0/${EXTEN:1},,TtoR)
    exten => _9XXXXX.,3,Hangup
8a. if your using freepbx based pbx then no need to above line , just you need to add g0 in the DAHDI identifier under trunk (add new dahdi trunk)
9. And the default incomming context will the from-pstn
Installing the DAHDI driver
a. you need to install libpri if you use pri lines
b. go to http://www.asterisk.org/downloads and download the latest libpri
c. as of writing this blog 1.4.12 is latest
d. wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.12.tar.gz
c. tar -xvzf  libpri-1.4.12.tar.gz
d. cd libpri-1.4.12
e. make
d. make install
e. now you need to install dahdi.
1.go to http://www.asterisk.org/downloads and download the latest dahdi
as of writting this blog its 2.6.1 so
2. wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.6.1+2.6.1.tar.gz
3. tar -xvzf  dahdi-linux-complete-2.6.1+2.6.1.tar.gz
4. cd dahdi-linux-complete-2.6.1+2.6.1.
5. make all
6. make install
7. make config.
once done follow the above steps to configure your card.

Tuesday, July 2, 2013

Vicidial MySQL connect ERROR


Troubleshoot the goautodial server if you face above problem
Cause for the above error
1. Mysql crashed or mysql stopped
2. Either the goautodial server shutdown all of sudden due to powercut or imporper shutdown (pressing the powerbutton directly)
3. Overload of server leads to mysql crash
4. Shortage of Harddisk space 
Troubleshooting
Login to the server via ssh using putty
1. Check whether the harddisk is full  type  df -h
    /dev/mapper/VolGroup00-LogVol00
                      446G   54G  0  100% /
2. If it shows 100%  then the harddisk is full you need to delete the recordings and logs
3. go to /var/spool/asterisk/monitorDONE/ORIG
4. type rm -rf *     ### this will delete all the file under ORIG directory
5. if the above command displays cannot delete file too long  , then  download the WINSCP software and login to the server , or run this command " find . -type f -name "*.wav" | xargs -l500 rm -f " this will delete every 1500 files one by one and empty the folder.
6. Goto var/spool/asteirsk/monitoreDONE/ORIG
7. select all the files and click delete
8. Now go to /var/spool/asterisk/monitorDONE/MP3   ### if u record in gsm then goto GSM directory
9. select all and delete
9a. goto /var/log/  and delete  message.1,2,4 secure.1,2,3...  ,boot.1,2,3.....
10. now login to the server via ssh using putty
11. type /etc/init.d/mysqld start
12. type mysqlcheck -u root -pvicidialnow --auto-repair --check --optimize --all-databases
13. once finishes the repair of the MYSQL
14. reboot the server and check wheter you are getting above error

Troubleshoot due to powecut or overload on the server

1. login to the server via ssh using putty
2. type mysqlcheck -u root -pvicidialnow --auto-repair --check --optimize --all-databases
3. once repairing finished
4. reboot the server


 

Time synchronization Error , Vicidial ,Goautodial

Time synchronization Error in vicidial goautodial


there is a problem of time synchronization in your system .please contact administrator
The major cause for the time sync error are
  1. The vicidial based system is using  MeetMe conference , These MeetMe Conference Bridge requires a timing resources like  Dahdi or Zaptel.  if they are not loaded poperly then time sync error occurs
  2. wrong System timing . different timing in server and agent systems
  3. wrong time set for DB time , PHP time , server Time
  4. Not updated the New server ip for the vicidial /goautodial 
-------------------------------------------------------------------------------------------
Troubleshoot 1:

type  "mysqlcheck -u root -pvicidialnow --auto-repair --check --optimize --all-databases"

 once finishes the repair of the MYSQL
 reboot the server and chec.


Troubleshoot 2:
MeetMe Conference dahdi issue
  • make sure the dahdi/zaptel driver is installed properly
If you are not using any telephony cards then you need to use the dummy drivers
type:   modprobe dahdi_dummy
          dahdi_cfg -vvvvv
          asterisk  -vvvvvr
          module unload chan_dahdi.so
          module load chan_dahdi.so
  • Now login as agent and check whether the problem arises
  • For those using asterisk telephone cards like digium , sangoma ,allo use the below links 
  • Digium Sangoma
-------------------------------------------------------------------------------------------
Troubleshoot 3:
wrong server time
check the server time ,
type  date  in the linux console ,  it will display the current server time.  if the server time and timezone is wrong follow the below commands to change it.
  • rm /etc/localtime
  • ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
  • rdate -s time-a.nist.gov
  • chkconfig ntpd on
  • ntpdate pool.ntp.org
  • /etc/init.d/ntpd start
-------------------------------------------------------------------------------------------
Troubleshoot 3:

Check the db time php time from the vicidail report section


          if the time is different for all the three then follow the above trouble shoot and reboot the server.
-------------------------------------------------------------------------------------------
Troubleshoot 4:
If you have changed your server ip, dont forget to run the ip update script.
type the below command to update
/usr/share/astguiclient/ADMIN_update_server_ip.pl
and follow the onscreen steps , once done reboot the server and login as agent and check .
-------------------------------------------------------------------------------------------
Troubleshoot 5
If you have very big setup of vicidial , then Dahdi_dummy will not be sufficient to provide time source , so you can use the Sangoma voice time sync USB stick
-------------------------------------------------------------------------------------------
For Support
gtalk:sweetravinder
skypeid:sweetravinder | sweetravinder@gmail.com

How to " reinstall " or " uninstall " or " upgrade " sangoma wanpipe driver

Sangoma Wanpipe Driver Reinstall or Uninstall or Upgrade to latest version
  • Following steps is for Reinstalling or uninstalling or upgrading the Sangoma Wanpipe Driver
Reinstalling/Uninstalling 
(for upgrade steps check the last steps)

step 1 ---  Check the wanpipe version installed
command to check the current version
wanrouter version

step 2 --- Go to the wanpipe source code of the installed version or download from sangoma for the same version
in my case i have downloaded the wanpipe in src directory
cd /usr/src/wanpipe-"version no"

if you dont have the source file then download the same version from the below link and untar the file

Step 3 --- uninstalling the wanpipe
wanrouter stop
wanrouter modules  ;to check if any loaded
./Setup remove

Step 4 --- installing the latest wanpipe driver or installing the any version of wanpipe which downloaded
- move to the wanpipe source folder and run below command
cd /usr/src/wanpipe-currentveriondownloaded/
./Setup dahdi    ; as i am using dahdi driver if you use zaptel then run ./Setup  zaptel

****** reinstallation done here ************************************
******below steps is for upgrading the wanpipe to latest *****

Wanpipe Upgrade 

  • Download the Latest wanpipe from the below link 
  • untar the file and move to the folder
  • wanrouter stop
  • cd /usr/src/wanpipe-currentversion
  • cd /util/wan_aftup
  • ./update_aft_firm.sh
*************END of WANPIPE UPGRADE********************