Asterisk do not sees queue members - asterisk

I have realtimequeue. After restarting asterisk do not sees queue members. When execute on cli this command “queue pause member SIP/111” get this error.
Unable to pause interface 'SIP/111’
Command ‘queue pause member SIP/111’ failed.
But after execute this command “queue show” Asterisk sees all queue members.
Note: I use realtime config.
[settings]
queues => odbc,asteriskdb,queue_table
queue_members => odbc,asteriskdb,queue_member_table
queue_log => odbc,asteriskdb,queue_log

That is normal behavour for realtime queues.
However they still can work and queue will be fetched on first request. It designed so to support thousands of "lazy" queues.
If you want it always be in memory, use realtime config store method.

Related

How do I use Laravel notification toArray or toDatabase method with 'database' queue connection

I asked this question: Laravel notification toArray() not saving data to notifications table and afterwards, I just thought to change my queue connection back to 'sync' from 'database' and I found out that the toArray method saved to the notifications table.
I'm not sure there's anything in the docs under notifications or queues about a specific queue connection to use with the toArray or toDatabase methods.
Is it that these methods don't work with 'database' queue connection or there's something else I need to do to make them work together?
Clear the cache of your application
php artisan optimize:clear

Asterisk HANGUPCAUSE always 0 when caller hangs up Queue

Using Asterisk 11, with an inbound route configured to call Queue app, every time the caller hangs up the HANGUPCAUSE variable is 0, it works and returns the NORMAL_CLEARING code only when the assigned queue member hangs up or if not using queues. Example code:
[from-trunk]
exten => s,1,Answer()
same => n,Queue(queue-1,rkt,,,30)
exten => h,1,Verbose(Hangup cause is ${HANGUPCAUSE})
How to obtain a valid HANGUPCAUSE from calls answered with queues?
Asterisk HANGUP_CAUSE will show you only value of last Dial command and only for SOME channel types.
Queue generate 100500 of NEW calls and bridge it together to make functionality you want.
You can check cause in queue's branches(in each one can be DIFFERENT), using agents in Local/ channels.
You can use Queue app variables:
This application sets the following channel variables upon completion:
${QUEUESTATUS}: The status of the call as a text string.
TIMEOUT
FULL
JOINEMPTY
LEAVEEMPTY
JOINUNAVAIL
LEAVEUNAVAIL
CONTINUE
${ABANDONED}: If the call was not answered by an agent this variable will be
TRUE.
You also can use queue_log or CDRs.

Send email when asterisk fails to call

I have an asterisk which is originating various calls.
Which is the most elegant way to send and email (or more generally trigger an event) when it fails to call a certain amount of time in a row?
For instance: When more than 20 calls fail because of insufficient credit, send an email.
My solution: Schedule using crontab a scripts that grep log files (cdr-csv) and do the requested operation.
Most elegant/lower cpu usage is use AMI event listener and trigger UserEvent with request of email.
To trigger UserEvent you can use h extension
exten => _X.,1,Dial(SIP/trunk/${EXTEN},,o)
exten => h,1,ExecIF($[ ${DIALSTATUS} != "ANSWERED" ]?UserEvent(TrunkFailed,Status: ${DIALSTATUS})

How exactly does the a2billing softswitch generate call records?

I just installed Asterisk 11 and a2billing 2.01. I followed instructions for the a2billing installation and everything was OK. It works.
But... There are no call traces being recorded into the a2billing database!!!
As I understand it, it uses the "cc_call" table for call recording - but this table is empty!
I need all calls recorded, not only answered. I'm making calls via AGI using their PHP scripts. The following is my dial plan:
;For standard inbound call
[a2billing]
exten => _X.,1,NoOp(A2Billing Start)
exten => _X.,n,Agi(/usr/share/a2billing/AGI/a2billing.php,1)
exten => h,1,Hangup
This starts the IVR which tells me my account balance (how much money I have left), and then asks me to choose a number to dial.
I have a trunk for the call, created as has been recommended. After the call my balance is decreased; i.e., the call has been charged. But I cannot see any call records inserted into the database.
My questions are: How exactly does a2billing generate CDR's? What do I need to do to have the calls recorded?
As mentioned by arheops, A2billing store CDRs in it's own Mysql Database, within a table called cc_call, the table is very similar to the Asterisk CDR table but contains extra fields to store the buy/sell rates, cost of calls and relation to the rate/callplan tables.
When you send a call to the AGI, A2Billing will try first to authenticate the users, if it succeed then the outbound call will be saved.
A2Billing create cdrs via by agi script. You can got it in cc_call table.
For record calls you have change agi-confX and set key for recording(in config section of web)

What is mean by Action => 'ping' using send_action in Asterisk Manager Interface script?

I have started to read about Asterisk::AMI module.
In that module if we want to send the action to the AMI server,we need to use the Action with action name using send_action method.
In that module they mentioned about Action => 'Ping' within send_action method.
Here what is the use of Action => 'Ping'.Can anyone explain me about it.
send_action({ Action => 'Ping',
CALLBACK => \&method,
});
Thanks in advance.
The Asterisk Manager Interface (AMI) allows a client program to connect to an Asterisk instance and issue commands or read events over a TCP/IP stream
Action: A packet sent by the connected client to Asterisk, requesting a particular Action be performed. There are a finite (but extendable) set of actions available to the client, determined by the modules presently loaded in the Asterisk engine. Only one action may be outstanding at a time
Action => Ping
gives Keep alive packet to be sent from the client to Astersik
Action: Ping
Synopsis: Keepalive command
Privilege: <none>
Description: A 'Ping' action will elicit a 'Pong' response. Used to keep the
manager connection open.
Variables: NONE
You can get basic help for any Asterisk AMI command from within the Asterisk CLI
interface by typing
manager show command yourCommand
You can see an entire list of supported commands by typing
manager show commands
BTW the shell command to get to the Asterisk CLI is
asterisk -r
I think this is a just a keep alive. Asterisk Manager Interface is known for being a little unreliable. Astmanproxy is a good way to fix that.

Resources