Reporting IVR/Inbound Routes/Ring Groups

Hello,

i’m trying to find out how many calls i receive in various points of my dial plan, like for example how many people enter my IVR, how many people press 1, 2 3 there, how many times a Ring Group is called and so on.

what would be the best way to accomplish this?

thanks

AstMan64

hello AstMan64,
IMHO you could use MYSQL connection, and on check points to make some insertion in DB.
Which you can afterwards easily to manipulate get some statistics etc.

okay,

so the information is not stored in any log files like queue info is stored in queue_log and so on ?

i already use MYSQL for cdr.

IVRs are abstractions created by the GUI. To Asterisk, they are just normal dialplan fragments, with no special meaning.

Queues are intrinsic to Asterisk.

You can parse asteirsk log file, but I suppose it will take a lot of time and energy to get this done.
In CDR which are stored in mysql you can use userfield to store some user specific data for each call.

[quote]F.e. if user press one, and so on.
exten => s,1,Set(CDR(accountcode)=IVR_1)[/quote]

But if you want more complex solution you can use Mysql.
voip-info.org/wiki/view/Asterisk+cmd+MYSQL

[quote=“eg”]You can parse asteirsk log file, but I suppose it will take a lot of time and energy to get this done.
In CDR which are stored in mysql you can use userfield to store some user specific data for each call.

[quote]F.e. if user press one, and so on.
exten => s,1,Set(CDR(accountcode)=IVR_1)[/quote]

But if you want more complex solution you can use Mysql.
voip-info.org/wiki/view/Asterisk+cmd+MYSQL[/quote]

thanks, i’ trying the MYSQL command now, however, it does not seem to do much ( no errors in the CLI either ), when i try
"exten => 6699,n,System(mysql…)" it seems to work.

im using asterisk 1.8.1.1

by the way, is there a way i can keep using freepbx when i also make dialplan changes in the config files ( for the reporting )

thanks.

Using MySQL for a logging system is a bit more complicated than simply calling System(mysql…

First, define exactly what you want to log. Then define how you want to store it for ease of logging and reporting. Do you have any resources that are familiar with databases? If so, then I would suggest you get some assistance from them in the design.

Once you decide what the database is going to do, you have to create the database, the table(s) and grant access to a userid to update those table(s).

I then recommend that you setup ODBC and create functions in func_odbc.conf that will allow you to easily update the tables within the dialplan. You can do it by calling System(), but it is not efficient and is difficult to get relevant responses back from the call. With func_odbc.conf, you can add a single line of dialplan code like the following, assuming the the database has fields for the uniqueid, the IVR menu name and the option number being pressed.

exten => 6699,n,Set(IVR_USAGELOG()=${UNIQUEID},MAIN_MENU,‘OPTION 3’);

REMEMBER, this is an example and there is a bunch of setup behind making this one line work.

If using FreePBX, there are options for inserting you own code. If you are creating something new, then you can place the dialplan code in extensions_custom.conf. If you are trying to make something that is generated by FreePBX do something different, which is what I believe you are trying to do, then you would copy the code t extensions_verride_freepbx.conf and make your changes there.

the code that i used was:

(doesnt work)

exten => 6920,n,MYSQL(Connect connid localhost asterisk pass asteriskcdrdb)
exten => 6920,n,MYSQL(Query resultid ${connid} INSERT\ INTO\ ivr(UniqueID)\ values\ ('${UNIQUEID}'))
exten => 6920,n,MYSQL(Clear ${resultid})
exten => 6920,n,MYSQL(Disconnect ${connid})

and
(works)

exten => 6920,n,System(mysql -u asterisk -h localhost --password=pass -e "INSERT INTO ivr(UniqueID) values ('${UNIQUEID}')" asteriskcdrdb)

i didn’t realise i had to modify more config to make this work,

I was describing the steps for working with ODBC and func_odbc, I did not realize that you were using the app_mysql.so module.

I have not used that app myself before but I did find a page at voip-info.org/wiki/view/Asterisk+cmd+MYSQL

According to that page, depending on your asterisk version the escaping of the spaces may not be required, or desired.

I tried a couple of tests on my 1.8.7 system.

This failed…
same => n,MYSQL(Query resultid ${connid} INSERT\ into\ agents\ (login_id,name)\ values\ (‘1234’,’${myname}’))

This Worked
same => n,MYSQL(Query resultid ${connid} INSERT into agents (login_id,name) values (‘1234’,’${myname}’))

Hope that helps