Is there a way of setting the exact time a call was answered as variable?

ghurty

Senior Member
Joined
Jan 13, 2009
Messages
852
Reaction score
4
Is there a way of setting the exact time a call was answered as variable? That way it can be used when writing to a database as a unique ID number?


Thanks
 
The time a call was answered would not be guaranteed to be unique.

Asterisk assigns the global variable UNIQUEID to each channel, which is recorded in the CDR, I would suggest using that.

Other useful global channel variables are context, priority, exten, and channel.

Joe
 
Hi

They offer some suggestions in that post. The issue, as they explained, is that the uniqueid is based on the channel, so when the channel changes, so does the unique ID, this also explains why the CDR in Asterisk are a bit of a mess!

It would depend on your application as to what you need to do - e.g. your unique key could be a serial number incremented by 1.

E.g. create record with key first, then write to the record previously created.

Joe
 
What I am trying to do is write a basic app that will allow the following:

There is a charity organization in town that gives supplies to families in need.

Until now, after a volunteer would provide some supplies, they would have to go onto a computer a log it in (for inventory and record purposes).

So the set up would be as follows:
Volunteer calls in, gets prompted for ID and PIN code.
Once authenticated.
They will type in the family ID#.
Then they will type in the Item ID# that they provided, and quantity. It will then give them the option of entering additional items.

For record purposis, I am trying to have every entery done in one call logged and linked together. So that is why I need to have a unique ID #.

While I am on this subject, I know it is possible to pass values to a php script (which is what I am planning on doing) but is it possible to receive values back from a php script? I am thinking of using that for the authentication set up.

Thank You
 
Here is what I coded so far.
I am trying to figure out how how to do the userID and PIN part.

Also, is it better for me to be using php files (like I am trying to do.) or better to use ODBC connect module that comes with PiaF?

Any other comments about my code?
Code:
Reworking code
Thanks
 
Hi

You can address a MySQL database directly in the asterisk dial plan, without using ODBC.

So I would have a series of tables, such as user account, ID tables etc, and address the tables directly.

See here for the syntax

http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

Personally, I use Apstel for this kind of stuff, it makes orting out the syntax easier.

Joe
 

Members online

No members online now.

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top