Skip to main content

Posts

Showing posts from December, 2022

 Vicidial Custom incoming Call Report

 Vicidial incoming Call Report create an all calls report in a nice table with the phone number, date and time of call, term reason, seconds per call, and agent on the call using this code Create call_report.php in /srv/www/htdocs <?php     $url1=$_SERVER['REQUEST_URI'];     header("Refresh: 40; URL=$url1");     echo "<h1>Calls Past 7 Days</h1>";     echo "<h5>*Refreshes every 40s</h5>";     $servername="localhost";     $username="cron";     $password="1234";     $dbname="asterisk";     $conn=new mysqli($servername, $username, $password, $dbname);     if ($conn->connect_error) {        die("Connection failed:  " . $conn->connect_error);     }     $query="select phone_number, call_date, status, term_reason, length_in_sec, user from vicidial_log where call_date > timestampadd(day, -7, now()) ;";     $result=$conn->query($query);     if ($result->num_

Adding Listen, Whisper, and Barge to FreePBX or Asterisk

  If you are running a call center on FreePBX or Asterisk, most likely you will want the ability to listen in on agents calls, also known as joining multiple calls, or connected two calls to a manager, or other variations of barging in on a bridged channel. For the purpose of this article, we will define  manager as the callee who is the spying channel,  agent who is the spied-on channel, and  client who is the bridged channel / 3rd party. We define listen, whisper, and barge as follows: Listen: Monitor an agents call. The manager can hear both the agent and client channels, but no-one can hear the manager. Whisper:   Whisper to the agent. The manager can hear both the agent and client channels, and the agent can also hear the manager, but the client can only hear the agent, hence “whisper.” Barge: Barge in on both channels. The manager channel is joined onto the agent and client channels, and all parties can hear each other. Be warned, if the original agent leaves the

Click to Call API for Asterisk/Freepbx

Click to Call API for Asterisk/Freepbx     Create call.php file in /var/www/html/ paste below mention code in call.php and replace context and manager username password <?php error_reporting(E_ALL); ini_set('display_errors', 1);   $strUser = "ccserver"; #specify the asterisk manager username you want to login with $strSecret = "ccserver"; #specify the password for the above user $strHost = "127.0.0.1"; //Clean up EXT $ext = $_GET['exten']; $ext = filter_var($ext, FILTER_SANITIZE_NUMBER_INT); $ext = preg_replace("/[^0-9,.]/", "", $ext); $strChannel = "SIP/".$ext; $strContext = $_GET['cnt']; $strWaitTime = "30"; #Wait Time before hangin up $strPriority = "1"; $strMaxRetry = "2"; #maximum amount of retries if(isset($_GET['number'])){ $number=strtolower($_GET[' number']);} elseif(isset($_GET['phone'])){ $number=strtolower($_GET[' phone']); } /

TATA SIP WITH ISABEL PBX

  https://community.freepbx.org/ t/p-preferred-identity/14261 I added following to extensions_custom.conf but no lcuk! [from-internal-custom] exten => X,1,SipAddHeader(P-Preferred- Identity: sip:${CALLERIDNUM} ) I added followings to trunk settings. now working good!! sendrpid=pai trustrpid=no

Elastix/IssabelPBX/ASTERISK API

Elastix API Elastix and Asterisk API Provider to make FreePBX easy to manage, written in PHP4. Installation Open your Elastix (CentOS) terminal, and go to elastix directory, then download it: cd /var/www/html git clone https://github.com/101t/elastix-api.git Open api.php and generate token key then replace it in: $ this -> key = 'YOUR_SECRETKEY_50_RANDOM_CHARS' ; Now you have elastix api ready to use it. Useful API functions This api package can implement: Get Authentication Get SIP Peers Get SIP Extensions Check System Resources Get CDR Report Get *.wav files Get Hard Driver State Check IPTable Status Get Active Call (Live Calls) SIP Trunk / Extension Management (Create, Update, Delete, Read) Follow Me Extension Management (Create, Update, Delete, Read) Documentation Installation and developer guide here .

Allow recording link/filename on web with full name

  To enable web browsing of Recordings on Asterisk server, add the below line  at last line of httpd.conf   Alias /RECORDINGS/ “/var/spool/asterisk/ monitorDONE/” <Directory “/var/spool/asterisk/ monitorDONE”> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all <files *.mp3> Forcetype application/forcedownload </files> </Directory> Restart the Apache web server to apply the changes service httpd restart chkconfig httpd on

How to delete old call logs and other logs in vicidial or goautodial

  Description: How to delete old call logs and other logs in vicidial or goautodial. Step 1 : SSH to the server using the Putty Step 2:   login to mysql by typing   mysql -p                    (if you dont know password try below command )               mysql -ucron -p1234 Step 3 : select the asterisk database by typing               use asterisk step 4: Run the below command to check total disk occupied by asterisk database                SELECT table_schema AS "asterisk", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema; Step 5 : Run the below command to check disk space consumed by each table in asterisk database SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "asterisk" ORDER BY (data_length + index_length) DESC; Step 6 : as per the above output, i will b

JIO SIP TRUNK CONFIGURATION WITH ASTERISK

 SBC IP:- 100.64.216.4 PORT:- 5060 CUBE/CLIENT IP:- 100.65.130.205 NET MASK :-         255.255.255.240 GATEWAY:-          100.65.130.193 [JIOSIP] disallow=all allow=ulaw allow=alaw type=friend dtmfmode=rfc2833 context=trunkinbound qualify=yes insecure=port nat=yes host=100.64.216.4 fromdomain=100.65.130.205 ; required for DID num username=7935344XXX fromuser=+917935344XXX sendrpid=yes trustrpid=yes canreinvite=no exten => _9X.,1,AGI(agi:// 127.0.0.1: 4577/call_log ) exten => _9X.,2,Set(CALLERID(num)= +7935344XXX) ;or if you want to use Camp Callerid or CID group ;exten => _9X.,2,Set(CALLERID(num)=+${CALLERID(num)})  exten => _9X.,3,Dial(SIP/0${EXTEN:1}@JIOSIP,,tTo) exten => _9X.,4,Hangup Add below entry in crontab change eth0 according your NIC.  @reboot /usr/bin/route add 100.64.216.4 gw 100.65.130.193 dev eth0 @reboot /usr/bin/route add 100.64.216.5 gw 100.65.130.193 dev eth0 @reboot /usr/bin/route add 100.64.216.0 gw 100.65.130.193 dev eth0

Missed calls Notification on Email (Issabel, FreePBX, Elastix, Asterisk)

  This is a simple cronJob to send automatic a custom CDR email every 10 minutes that will include all missed calls of this period. Create a php file named missed_calls.php code:- <?php //error_reporting(0); /*------------------------------------------------------------------------ # copyright Copyright (C) 2018 sbzsystems.com. All Rights Reserved. # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL # Websites: https://www.sbzsystems.com -------------------------------------------------------------------------*/ header ( "Cache-Control: no-cache, must-revalidate" ) ; // HTTP/1.1 header ( 'Content-Type: text/html; charset=UTF-8' ) ; //error_reporting(0); $host = 'localhost' ; $user = 'root' ; $password = 'XXXXXXXX' ; $db = 'asteriskcdrdb' ; $logfile = '/usr/local/issabel/missed_calls.log' ; // Connects to your Database $link = mysqli_connect ( "$host" , $user

Configuring Gmail as a Sendmail email relay

  Configuring Gmail as a Sendmail email relay Sendmail is email routing software that can allow Linux systems to send an email from the command line . This allows you to send email from your bash scripts , hosted website, or from command line using the mail command . Another example where you can utilize this setting is for notification purposes such as failed backups, etc. In this guide, we’ll go over the step by step instructions to configure Gmail as a relay for the sendmail client on Linux. Note that Sendmail is just one of many utilities which can be configured to rely on a Gmail account. Others that are capable of this include postfix, exim, ssmpt, etc. The instructions here should work for any mainstream Linux distribution . In this tutorial you will learn: Gmail configuration prerequisites How to install Sendmail and mail utilities on Linux How to configure Gmail as a relay for Sendmail How to test the config by sending an email from command line Configuring Gma

Capture PCAP file in LInux

  For Capture network interface pcap manually  you need to install tcpdump using below mention command. Centos 7 yum install tcpdump -y  tcpdump -w filename.pcap -i adapter_name   Example for eth1 interface pcap capture  tcpdump -w trace.pcap -i eth1    You can use sngrep as well  sngrep install centos 7 linux First of all, add the irontec repository to centos Repos. Create file named sngrep . repo   in / etc / yum . repos . d  folder and add the following repository to install sngrep. nano  / etc / yum . repos . d / sngrep . repo   Now add the following repository. [ irontec ] name = Irontec RPMs repository baseurl = http : //packages.irontec.com/centos/$releasever/$basearch/ Then Import the Irontec repositories public key using the following command. rpm -- import http : //packages.irontec.com/public.key Now update the yum cache and install the sngrep using the following comman