Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

lunes, 5 de febrero de 2018

reset root password on freepbx centos 7



To get started, turn on the machine that you’ve forgotten the root password on. For CentOS 7 devices, you’ll be given 5 seconds at the boot menu to select the operating system kernel to boot into.
That 5 seconds is important, because allows for  admins to select different kernels or edit existing kernel parameters before booting.
At the boot menu, press e to edit the existing kernel (Core) as shown below.
Changing root password on centos 7

Next, scroll down to the list until you see the line underlined below ( ro ) . What we need to do is change that ro to rw and start into a bash shell. It should look like this rw init=/sysroot/bin/sh.

forgotten root password on centos 7


Change the ro line to rw and add init=/sysroot/bin/sh
rw init=/sysroot/bin/sh
changing root password on centos

After changing that, press Control + X  or Ctrl + X  on your keyboard to start into single user mode using the bash shell specified above. In this mode, we’re going to change the root password.
In the single user mode, run the command as shown below
chroot /sysroot
password change on centos 7

Finally, run the commands below to change the root password.
change password on centos 7

You’ll be prompted to create and confirm a new password.  After creating the password, run the commands below to update SELinux parameters
touch /.autorelabel

Exit and reboot your system. You should be able to sign on and use the system with the new password you created. That’s how you change the root password on CentOS 7.

https://www.liberiangeek.net/2014/09/reset-forgotten-root-password-centos-7-servers/

jueves, 1 de febrero de 2018

logs analisis

Context control:
  -B, --before-context=NUM  print NUM lines of leading context
  -A, --after-context=NUM   print NUM lines of trailing context
  -C, --context=NUM         print NUM lines of output context


PRINT  4 lines after  the line  SIP/VoxBeam_Out-0003c180

grep -A4 SIP/VoxBeam_Out-0003c180  full


[2018-02-01 18:20:26] VERBOSE[10552][C-0001d31e] app_dial.c: SIP/VoxBeam_Out-0003c180 is circuit-busy
[2018-02-01 18:20:26] VERBOSE[10552][C-0001d31e] app_dial.c: Everyone is busy/congested at this time (1:0/1/0)
[2018-02-01 18:20:26] VERBOSE[10552][C-0001d31e] pbx.c: Executing [s@macro-dialout-trunk:31] NoOp("SIP/3004-0003c17f", "Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 38") in new stack
[2018-02-01 18:20:26] VERBOSE[10552][C-0001d31e] pbx.c: Executing [s@macro-dialout-trunk:32] GotoIf("SIP/3004-0003c17f", "0?continue,1:s-CONGESTION,1") in new stack
[2018-02-01 18:20:26] VERBOSE[10552][C-0001d31e] pbx_builtins.c: Goto (macro-dialout-trunk,s-CONGESTION,1)

miércoles, 31 de enero de 2018

retrieve_conf error after backup restore

https://community.freepbx.org/t/unable-to-apply-config-after-restore-from-backup/30432/6

This is Fixed Removing the password that it is on CDR setting on advancet settings  (JUST THE PASS)

viernes, 26 de enero de 2018

Troubleshooting Asterisk Module Loading


Saltar al final de los metadatos
Ir al inicio de los metadatos

Symptoms

  • Specific Asterisk functionality is no longer available or completely non-functioning, but other Asterisk features and modules continue to function.
  • Specific Asterisk CLI commands are no longer available.
Example:
No such command 'sip show peers'
We can presume that something is wrong with chan_sip module since we know it provides the 'sip' commands and sub-commands.

Problem

Asterisk has started successfully and the module providing the missing functionality either didn't load at all, or it loaded but isn't running.
The reason for the failure to load or run is typically invalid configuration or a failure to parse the configuration for the module.

Solution

Identify the state of the module. If the module is loaded but not running, or not loaded at all, then resolve file format, configuration syntax issues or unwanted modules.conf configuration  for the specific module. Restart Asterisk.

Troubleshooting

Check Module Loaded and Running States

From the Asterisk CLI you can use the 'module show' commands to identify the state of a module.
Previous to Asterisk 12, you could only see if the module is loaded. However it may not actually be running (usable).
*CLI> module show like chan_sip.so 
Module                         Description                              Use Count 
chan_sip.so                    Session Initiation Protocol (SIP)        0         
1 modules loaded
In Asterisk 12 and beyond you can quickly see if a module is loaded and whether it is running or not.
*CLI> module show like chan_sip.so 
Module                         Description                              Use Count  Status
chan_sip.so                    Session Initiation Protocol (SIP)        0          Not Running
1 modules loaded

Make sure Asterisk is configured to load the module

Modules.conf is a core configuration file that includes parameters affecting module loading and loading order. There are a few items to check.
Verify that autoload=yes is enabled if you are intending to load modules from the Asterisk modules directory automatically.
Verify that there is not a 'noload' line for the module that is failing to load. That is, if we had a line as follows:
noload => chan_sip.so
That would tell Asterisk to not load chan_sip.so.
If you are not using autoload, then be sure you have a load line for the module you desire to load.
load => chan_sip.so

Check For Module Loading Issues on Asterisk Startup

Now that we know the suspect module should be loading, we can look at some logs that may tell us what is happening.

Stop Asterisk

Be sure Asterisk is stopped to avoid issues with making the logs confusing.
asterisk -rx "core stop now"
or
service asterisk stop

Enable logging channels

You can read in detail about Logging facilities on the wiki. In short, for this example, make sure you have the following lines uncommented in your logger.conf file.
[logfiles]
full => notice,warning,error,debug,verbose

Clear out old logs

You don't want to mistakenly look at an older log where Asterisk was loading appropriately.
Remove the most recent log file, or else move it somewhere you want to keep it.
# rm /var/log/asterisk/full

Start Asterisk with appropriate log levels

It is important to start Asterisk with log levels that will provide us enough information.
# asterisk -cvvvvvddd
You'll see a lot of information output in the terminal as Asterisk loads.

Stop Asterisk after it has finished loading

After the output calms down and Asterisk has finished loading, go ahead and stop Asterisk. The logs should have already been recorded.
*CLI> core stop now

Search logs for lines related to suspect module

Search the log file using keywords based on the specific module that appeared to be failing to load or run.
/var/log/asterisk# grep -i chan_sip full
[Oct  9 14:54:43] VERBOSE[21809] chan_sip.c: SIP channel loading...
[Oct  9 14:54:43] ERROR[21809] chan_sip.c: Contents of sip.conf are invalid and cannot be parsed

/var/log/asterisk# grep -i sip.conf full
[Oct  9 14:54:43] DEBUG[21809] config.c: Parsing /etc/asterisk/sip.conf
[Oct  9 14:54:43] VERBOSE[21809] config.c:   == Parsing '/etc/asterisk/sip.conf': Found
[Oct  9 14:54:43] WARNING[21809] config.c: parse error: No category context for line 1 of /etc/asterisk/sip.conf
[Oct  9 14:54:43] ERROR[21809] chan_sip.c: Contents of sip.conf are invalid and cannot be parsed
[Oct  9 14:54:55] DEBUG[21809] config.c: Parsing /etc/asterisk/sip.conf
[Oct  9 14:54:55] VERBOSE[21809] config.c:   == Parsing '/etc/asterisk/sip.conf': Found
[Oct  9 14:54:55] WARNING[21809] config.c: parse error: No category context for line 1 of /etc/asterisk/sip.conf
Based on the lines found, you can then use an editor like VIM to view the full log and jump to where the relevant messages are.
[Oct  9 14:54:43] VERBOSE[21809] chan_sip.c: SIP channel loading...
[Oct  9 14:54:43] DEBUG[21809] config.c: Parsing /etc/asterisk/sip.conf
[Oct  9 14:54:43] VERBOSE[21809] config.c:   == Parsing '/etc/asterisk/sip.conf': Found
[Oct  9 14:54:43] WARNING[21809] config.c: parse error: No category context for line 1 of /etc/asterisk/sip.conf
[Oct  9 14:54:43] ERROR[21809] chan_sip.c: Contents of sip.conf are invalid and cannot be parsed
In this case, not much more is revealed past what we saw with grep. You can see that Asterisk tries to load and run chan_sip, it fails because the contents of sip.conf are invalid and cannot be parsed. The most specific clue is the WARNING:
WARNING[21809] config.c: parse error: No category context for line 1 of /etc/asterisk/sip.conf

Edit the related config file to resolve the issue

If we look at line 1 of sip.conf we'll spot the root problem.
general]
context=public
allowoverlap=no
For our example, a square bracket is missing from the context definition! Fix this issue, restart Asterisk and things should work assuming I don't have any other syntax errors.

miércoles, 24 de enero de 2018

Python Ari

https://github.com/asterisk/ari-examples

https://github.com/asterisk/ari-py

miércoles, 17 de enero de 2018

FreePBX database read

Reading  all DB values
database show
/AMPUSER/101/answermode                           : disabled
/AMPUSER/101/callmenum                            : 101
/AMPUSER/101/cfringtimer                          : 0
/AMPUSER/101/cidname                              : CV Testing
/AMPUSER/101/cidnum                               : 101
/AMPUSER/101/concurrency_limit                    : 0
/AMPUSER/101/device                               : 101
/AMPUSER/101/noanswer                             : <bad value>
/AMPUSER/101/outboundcid                          : "InfoFlo" <6464657676>
/AMPUSER/101/password                             : <bad value>
/AMPUSER/101/queues/qnostate                      : usestate
/AMPUSER/101/recording                            : out=Never|in=Never
/AMPUSER/101/ringtimer                            : 0
/AMPUSER/101/voicemail                            : default
/AMPUSER/102/answermode                           : disabled
/AMPUSER/102/cfringtimer                          : 0
/AMPUSER/102/cidname                              : CV Testing 102
/AMPUSER/102/cidnum                               : 102

read values for DB key  AMPUSER/102
 database show AMPUSER/102
/AMPUSER/102/answermode                           : disabled
/AMPUSER/102/cfringtimer                          : 0
/AMPUSER/102/cidname                              : CV Testing 102
/AMPUSER/102/cidnum                               : 102
/AMPUSER/102/concurrency_limit                    : 0
/AMPUSER/102/device                               : 102
/AMPUSER/102/noanswer                             : <bad value>
/AMPUSER/102/outboundcid                          : <bad value>
/AMPUSER/102/password                             : <bad value>
/AMPUSER/102/queues/qnostate                      : usestate
/AMPUSER/102/recording                            : out=Always|in=Always
/AMPUSER/102/ringtimer                            : 0
/AMPUSER/102/voicemail                            : default
13 results found.



read specific one
database show AMPUSER/102/answermode
/AMPUSER/102/answermode                           : disabled

domingo, 14 de enero de 2018

twilio recordings

https://www.twilio.com/docs/api/voice/recording


<?php
//require_once("ipfilter.php");
// Required if your environment does not handle autoloading
require __DIR__ . '/vendor/autoload.php';

// Use the REST API Client to make requests to the Twilio REST API
use Twilio\Rest\Client;

// Your Account SID and Auth Token from twilio.com/console
$sid = 'ACab9bdb1111111eb1f';
$token = 'bcbc19496011111763370e58832';
$recording_sid="RE7ffa59d2224ff863822315fd1cf6";
$client = new Client($sid, $token);

// Loop over the list of recordings and echo a property for each one
foreach ($client->recordings->read() as $recording) {
   echo " Duration $recording->duration<br>";
   echo " Duration $recording->sid<br>";
       echo "  $recording->uri <br>";

print_r($recording);

}

 ?>