Soporte & Consultoria

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

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);

}

 ?>

sábado, 13 de enero de 2018

twilio twiml

<?php
    header("content-type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
    <Say loop="2">This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below</Say>
    <Dial timeout="10" record="false">+18097141429</Dial>

</Response>



Twilio call





https://www.twilio.com/docs/guides/how-to-respond-to-incoming-phone-calls-in-php#create-php-responses-to-incoming-calls

https://www.twilio.com/docs/quickstart/php/twiml/say-response#hello-monkey-v10

https://www.twilio.com/docs/api/twiml

https://www.twilio.com/docs/quickstart/php/twiml/greet-caller-by-name#greet-caller-by-name


https://www.twilio.com/docs/guides/how-to-gather-user-input-via-keypad-in-php#handle-action-url-request-in-a-different-end-point

https://www.twilio.com/docs/quickstart/php/twiml/say-response#prerequisites

twilio verb
https://www.twilio.com/docs/api/twiml/say

https://support.twilio.com/hc/en-us/articles/223132827-What-languages-can-the-Say-verb-speak-



1 dial example




<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Dial timeout="10" record="true">415-123-4567</Dial>
</Response>
-------------------------------------------------------------------------------------------2 Hello php
<?php
    header("content-type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
    <Say loop="2">This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below</Say>
</Response>

----------------------------------------------------------------------------------
3 pure xml version<?xml version="1.0" encoding="UTF-8" ?>
<Response>
    <Say voice="alice" language="pt-BR" loop="2">Bom dia.</Say>
</Response>  

a2billing caller id

auto_setcallerid = Yes    |    force_callerid = [BLANK]    |    cid_sanitize = No
agi-conf2
The account number for the A2Billing customer we are using is 7599833548 –
a2billing account number
In the a2billing voip account settings we have nothing set –
voip settings caller ID
and in the A2Billing customer account we have no caller IDs set –
a2billing customer account caller ID
Now if we make a call from a SIP client (I’m using Zoiper) the A2Billing account number will be presented as the called ID, in this case “7599833548”. Actually if I call my mobile in the UK I get “+7599833548”. I think this is because the mobile provider is seeing it as a number in an international format.
In Zoiper (and in other clients it may be called something different) we have a setting for caller ID name –
zoiper caller id name
You should be aware though that, as far as Asterisk and A2Billing is concerned, caller ID number and caller ID name or 2 separate things. If we set the caller ID we want to be displayed in the “Caller ID Name” box this is NOT the number that will be presented when we make a call. However, look out for another blog post soon that will show how to do this!
Presenting a caller ID
Often what you will want to do is present a specific caller ID for a customer, or allow them to do it themselves.
There are a couple of ways to do this, this is the way I would recommend as being the most flexible.
In A2Billing / Settings / agi-conf2 / set cid_sanitize = ‘CID’ –
cid_sanitize
Now in the A2Billing customer account enter the caller ID that you want them to use –
add caller id
Now when I make a call I get “441604283000” presented as my caller ID.
And if I want to allow the customer to set their own caller ID I can go to A2Billing / Customers / Groups / Default – and allow the customer to see the Caller ID menu –
a2billing_customer_caller_id_menu
They will then see the Caller ID menu page in the customer GUI and be able to add new ones. If they add multiple entries I think the last one will be used –
a2billing_customer_caller_id_page
https://sysadminman.net/blog/2012/a2billing-outbound-caller-id-from-a-sip-client-4077

miércoles, 10 de enero de 2018

SIP re-INVITE

14 Modifying an Existing Session

A successful INVITE request (see Section 13) establishes both a dialog between two user agents and a session using the offer-answer model. Section 12 explains how to modify an existing dialog using a target refresh request (for example, changing the remote target URI of the dialog). This section describes how to modify the actual session. This modification can involve changing addresses or ports, adding a media stream, deleting a media stream, and so on. This is accomplished by sending a new INVITE request within the same dialog that established the session. An INVITE request sent within an existing dialog is known as a re-INVITE. Note that a single re-INVITE can modify the dialog and the parameters of the session at the same time. Either the caller or callee can modify an existing session. The behavior of a UA on detection of media failure is a matter of local policy. However, automated generation of re-INVITE or BYE is NOT RECOMMENDED to avoid flooding the network with traffic when there is congestion. In any case, if these messages are sent automatically, they SHOULD be sent after some randomized interval. Note that the paragraph above refers to automatically generated BYEs and re-INVITEs. If the user hangs up upon media failure, the UA would send a BYE request as usual.

14.1 UAC Behavior

The same offer-answer model that applies to session descriptions in INVITEs (Section 13.2.1) applies to re-INVITEs. As a result, a UAC that wants to add a media stream, for example, will create a new offer that contains this media stream, and send that in an INVITE request to its peer. It is important to note that the full description of the session, not just the change, is sent. This supports stateless session processing in various elements, and supports failover and recovery capabilities. Of course, a UAC MAY Rosenberg, et. al. Standards Track [Page 86]


RFC 3261            SIP: Session Initiation Protocol           June 2002


   send a re-INVITE with no session description, in which case the first
   reliable non-failure response to the re-INVITE will contain the offer
   (in this specification, that is a 2xx response).

   If the session description format has the capability for version
   numbers, the offerer SHOULD indicate that the version of the session
   description has changed.

   The To, From, Call-ID, CSeq, and Request-URI of a re-INVITE are set
   following the same rules as for regular requests within an existing
   dialog, described in Section 12.

   A UAC MAY choose not to add an Alert-Info header field or a body with
   Content-Disposition "alert" to re-INVITEs because UASs do not
   typically alert the user upon reception of a re-INVITE.

   Unlike an INVITE, which can fork, a re-INVITE will never fork, and
   therefore, only ever generate a single final response.  The reason a
   re-INVITE will never fork is that the Request-URI identifies the
   target as the UA instance it established the dialog with, rather than
   identifying an address-of-record for the user.

   Note that a UAC MUST NOT initiate a new INVITE transaction within a
   dialog while another INVITE transaction is in progress in either
   direction.

      1. If there is an ongoing INVITE client transaction, the TU MUST
         wait until the transaction reaches the completed or terminated
         state before initiating the new INVITE.

      2. If there is an ongoing INVITE server transaction, the TU MUST
         wait until the transaction reaches the confirmed or terminated
         state before initiating the new INVITE.

   However, a UA MAY initiate a regular transaction while an INVITE
   transaction is in progress.  A UA MAY also initiate an INVITE
   transaction while a regular transaction is in progress.

   If a UA receives a non-2xx final response to a re-INVITE, the session
   parameters MUST remain unchanged, as if no re-INVITE had been issued.
   Note that, as stated in Section 12.2.1.2, if the non-2xx final
   response is a 481 (Call/Transaction Does Not Exist), or a 408
   (Request Timeout), or no response at all is received for the re-
   INVITE (that is, a timeout is returned by the INVITE client
   transaction), the UAC will terminate the dialog.






Rosenberg, et. al.          Standards Track                    [Page 87]


RFC 3261            SIP: Session Initiation Protocol           June 2002


   If a UAC receives a 491 response to a re-INVITE, it SHOULD start a
   timer with a value T chosen as follows:

      1. If the UAC is the owner of the Call-ID of the dialog ID
         (meaning it generated the value), T has a randomly chosen value
         between 2.1 and 4 seconds in units of 10 ms.

      2. If the UAC is not the owner of the Call-ID of the dialog ID, T
         has a randomly chosen value of between 0 and 2 seconds in units
         of 10 ms.

   When the timer fires, the UAC SHOULD attempt the re-INVITE once more,
   if it still desires for that session modification to take place.  For
   example, if the call was already hung up with a BYE, the re-INVITE
   would not take place.

   The rules for transmitting a re-INVITE and for generating an ACK for
   a 2xx response to re-INVITE are the same as for the initial INVITE
   (Section 13.2.1).

14.2 UAS Behavior

Section 13.3.1 describes the procedure for distinguishing incoming re-INVITEs from incoming initial INVITEs and handling a re-INVITE for an existing dialog. A UAS that receives a second INVITE before it sends the final response to a first INVITE with a lower CSeq sequence number on the same dialog MUST return a 500 (Server Internal Error) response to the second INVITE and MUST include a Retry-After header field with a randomly chosen value of between 0 and 10 seconds. A UAS that receives an INVITE on a dialog while an INVITE it had sent on that dialog is in progress MUST return a 491 (Request Pending) response to the received INVITE. If a UA receives a re-INVITE for an existing dialog, it MUST check any version identifiers in the session description or, if there are no version identifiers, the content of the session description to see if it has changed. If the session description has changed, the UAS MUST adjust the session parameters accordingly, possibly after asking the user for confirmation. Versioning of the session description can be used to accommodate the capabilities of new arrivals to a conference, add or delete media, or change from a unicast to a multicast conference. Rosenberg, et. al. Standards Track [Page 88]


RFC 3261            SIP: Session Initiation Protocol           June 2002


   If the new session description is not acceptable, the UAS can reject
   it by returning a 488 (Not Acceptable Here) response for the re-
   INVITE.  This response SHOULD include a Warning header field.

   If a UAS generates a 2xx response and never receives an ACK, it
   SHOULD generate a BYE to terminate the dialog.

   A UAS MAY choose not to generate 180 (Ringing) responses for a re-
   INVITE because UACs do not typically render this information to the
   user.  For the same reason, UASs MAY choose not to use an Alert-Info
   header field or a body with Content-Disposition "alert" in responses
   to a re-INVITE.

   A UAS providing an offer in a 2xx (because the INVITE did not contain
   an offer) SHOULD construct the offer as if the UAS were making a
   brand new call, subject to the constraints of sending an offer that
   updates an existing session, as described in [13] in the case of SDP.
   Specifically, this means that it SHOULD include as many media formats
   and media types that the UA is willing to support.  The UAS MUST
   ensure that the session description overlaps with its previous
   session description in media formats, transports, or other parameters
   that require support from the peer.  This is to avoid the need for
   the peer to reject the session description.  If, however, it is
   unacceptable to the UAC, the UAC SHOULD generate an answer with a
   valid session description, and then send a BYE to terminate the
   session.

https://tools.ietf.org/html/rfc3261#page-37

lunes, 8 de enero de 2018

how to disable modules with freepbx

    fwconsole ma disable restapps
 
  fwconsole ma disable endpoint

     fwconsole reload

jueves, 4 de enero de 2018

end point manager notes







Phone url shoud be like this : http://206.152.47.147:83/

Make sure to specify usernameand pass added   for end point manager provisioning on   freepbx

https://www.youtube.com/watch?v=p3al27mMCAA&t=101s

https://wiki.freepbx.org/display/FPG/Supported+Devices-Yealink

https://wiki.freepbx.org/display/PHON/Setup+Phone+with+DHCP+Option+66


I didnt use but if you want to phone load config on boot need to factory reset and  configure option 66 on dhcp and tfp server name

***Setup DHCP Option 66
DHCP option 66 (TFTP Server Name) needs to be configured
on the DHCP server to provide the provisioning server URL ***