Save custom variable in SNEP CDR Database

Asked

Viewed 213 times

1

I have a server snep and by dial-plan I made a request at URA where the customer who called needs to enter his wallet.

I made the validations if the wallet exists in the client’s bank by direct odbc on the dial plan and it validates normally and only allows the connection to continue after the wallet exists.

What I need to do, and I don’t think how, is to pass this variable from the wallet to the responsible party in recording the links in the table CDR to a customized field "carteirinha" that I created in this same table.

  • Hello. What version of the SNEP is installed? What version Asterisk is used in your SNEP installation?

1 answer

1

You will need to configure the database and Asterisk version 1.8 or higher according to the following steps (tested in version 11):

  • add the "wallet" field in the cdr table of the database;
  • Set the 'wallet' field in the Asterisk dial plane using the CDR() function, as an example below;
  • reload the dial plane and module cdr_mysql, or restart Asterisk.

Example:

exten => s,1,...
exten => s,n,Read(numeroDaCarteirinha)
exten => s,n,Set(CDR(carteirinha)=${numeroDaCarteirinha})
... etc etc

NOTE: Tested with Asterisk 11, mysql 5.4 and running in Centos7

  • I’ll try really hard thank you

  • Excellent. Please give an Upvote if the answer proves useful.

  • Did it work? If yes, please mark the answer as a valid solution.

  • I can’t believe I’m still doing some tests. I did it the way you did but it doesn’t record in the bank. I have tried to set something fixed as exten => s,n,Set(CDR(card)='0001') but does not save in the table field

Browser other questions tagged

You are not signed in. Login or sign up in order to post.