Sunday, 29 December 2024

BLOCKING ANONYMOUS,PRIVATE,RESTRICTED,PSTN CALLS IN VICIDIAL

 Blocking Anonymous calls in vicidial


exten => _X.,1,Set(CALLERID(num)=${
CALLERID(num)})
exten => _X.,2,NoOp(${CALLERID(num)})
exten => _X.,3,GotoIf($["${CALLERID(
num)}" = "1000000000"]?who-r-u,s,1)
exten => _X.,4,GotoIf($["${CALLERID(
num)}" = ""]?who-r-u,s,1)
exten => _X.,5,GotoIf($["foo${CALLERID(
num)}" = "foo"]?who-r-u,s,1)
exten => _X.,6,GotoIf($["${CALLERID(
name):0:9}" = "Anonymous"]?who-r-u,s,1)
exten => _X.,7,GotoIf($["${CALLERID(
name):0:7}" = "Unknown"]?who-r-u,s,1)
exten => _X.,8,GotoIf($["${CALLERID(
num):0:7}" = "Private"]?who-r-u,s,1)
exten => _X.,9,GotoIf($["${CALLERID(
name):0:7}" = "Private"]?who-r-u,s,1)
exten => _X.,10,GotoIf($["${CALLERID(
num):0:10}" = "Restricted"]?who-r-u,s,1)
exten => _X.,11,GotoIf($["${CALLERID(
num):0:4}" = "PSTN"]?who-r-u,s,1)
exten => _X.,12,AGI(agi-DID_route.agi) 

[who-r-u]
exten => s,1,Background(privacy-
unident)
exten => s,2,Background(vm-rec-name)
exten => s,3,Wait(2)
exten => s,4,Record(/tmp/asterisk-
stranger:gsm,5,15)
exten => s,5,Playback(goodbye)
exten => s,6,Hangup
======================

DISK CLEAN ON VICIDIAL

 Delete logs

find /var/log/astguiclient -type f -mtime +1 -exec rm -f {} \;

Delete all   no time restrictions
/usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -print | xargs rm -f

delete only mp3 files other  than  7 days running this cron every  9 days

0 0 */9 * * /usr/bin/find /var/spool/asterisk/monitorDONE/MP3 -maxdepth 2 -type f -name "*.mp3" -mtime +7 -exec rm -f {} \;

VICIDIAL ADMIN PASSWORD KNOWN STEPS

If you forget the admin password on vicidial user. login to mysql then enter to asterisk databases then run the following command. 
1.Login to your mysql database. type the following 
mysql -ucron -p1234 asterisk 

2. once you entered the mysql cli type the following ie after the mysql> 

select * from vicidial_users where user='admin'; 

NOTE: in the field of user='admin' enter your admin username once entering the above command it will give you some quiries as below 

+---------+-------+-------------+-----------+------------+------------+-------------+------------+--------------+--------------------+--------------+------------------+-----------------+----------------------+------------+-----------------+------------------+-------------------+----------------+--------------+----------------+-----------------------+-----------------------+------------------+---------------------+---------------------+------------------+--------------------+--------------------+----------------+-------------------------------+------------------------+-------------------+-------------------+--------------+------------------+--------------+----------------+----------------+-----------------+-------------------+---------------------+----------------+--------------+-----------------------------+-------------------------+------------+---------------+---------+-----------+-----------+-------------------+----------------------+----------------------+--------------------------+----------------------+---------------------+---------------------+ | 1 | admin | vicidialnow | Admin | 9 | ADMIN | NULL | NULL | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | NULL | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | DISABLED | NOT_ACTIVE | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | NOT_ACTIVE | 0 | 0 | 0 | +---------+-------+-------------+-----------+------------+------------+-------------+------------+--------------+--------------------+--------------+------------------+-----------------+----------------------+------------+-----------------+------------------+-------------------+----------------+--------------+----------------+-----------------------+-----------------------+------------------+---------------------+---------------------+------------------+--------------------+--------------------+----------------+-------------------------------+------------------------+-------------------+-------------------+--------------+------------------+--------------+----------------+----------------+-----------------+-------------------+---------------------+----------------+--------------+-----------------------------+-------------------------+------------+---------------+---------+-----------+-----------+-------------------+----------------------+----------------------+--------------------------+----------------------+---------------------+---------------------+ 1 row in set (0.00 sec) 

it show your password next to your admin username as highlited in red

THREE LEVEL DIAL PLAN FOR INCOMING CALL MOVE TO . 1.EXTENSION 2. MOBILE NUMBER 3. VOICEMAIL.

 I'm trying to set up a call routing that would dial an extension first, if failed, then divert the call to a mobile number, if no answer then go to voicemail. What i have done is I created a Custom App and have the following call flow in there:


exten => 9184XXXXXXXX,1,GOTO(s,1)                                                                        
exten => s,1,Set(DivertNumber=194xxxxxxxx)                                                        
exten => s,2,Dial(SIP/147xxxxxxxx,18,
tr)                                                                      
exten => s,3,Dial(sip/${DivertNumber}@trunkname
,18,t)            
exten => s,4,Voicemail(85991@HSS)      
                                       
exten => s,5,Hangup()

Configuration for Voicemail if you want:-

vi /etc/asterisk/voicemail.conf                        should be an entry on a voicemail file like this.
[HSS]
85991 => 85991,abc,xxxxxx@gmail.com