VoiceGuide IVR Software Main Page
Jump to content

Saving logs in database

Recommended Posts

After getting incoming call all logs will be saved in folder but i want save that logs in database also please let me know how can i do this.

I want to save logs in database  for outgoing and incoming 

Share this post


Link to post

Do you want to save the entire CallEvents or vgEngine etc. logs in database? or some other logs?

Share this post


Link to post

Call event log like once calls ended i need to save complete information regarding the call in database.

Share this post


Link to post

The CallEvents log does not contain complete information about the call. It for example does not contain all the Result Variables created during the call etc.

Many users just save the selected information to database using a Database Query module ran from the 'After Hangup' script.

'After Hangup' script: https://www.voiceguide.com/vghelp/source/html/call_finish.htm

Database Query module: https://www.voiceguide.com/vghelp/source/html/moddbquery.htm

What are you trying to achieve by loading call events data into a database?

Would CDR records be enough?

CDRs are already saved into VoiceGuide's default backend database. See: https://www.voiceguide.com/vghelp/source/html/log_cdrs.htm

 

As far as a CallEvents log is concerned, it is in JSON format. You could write some external app that reads that file and loads information that is important to you from it at end of day into your database table.

Sample CallEvents entry below:

{ "call": {
  "crn": "8000001",
  "port": "1",
  "direction": "in",
  "time_start": "2019-01-07 19:37:38",
  "events": "
    193738.112|callstate|GCEV_OFFERED|10.1.1.76||10.1.1.59|[SIP_HDR_Request_URI]{sip:10.1.1.59}[SIP_HDR_Contact_URI]{sip:10.1.1.76:59761;ob}[SIP_HDR_CALLID]{3253bc02179c4d26bf7992643564511a}[SIP_HDR_FROM]{<sip:10.1.1.76>;tag=a58464dac8d94d918f1ea426c3655a02}[SIP_HDR_TO]{<sip:10.1.1.59>}[SIP_Header_Via]{SIP/2.0/UDP 10.1.1.76}[SIP_Header_From]{<sip}[SIP_Header_To]{<sip}[SIP_Header_Contact]{<sip}[SIP_Header_Call-ID]{3253bc02179c4d26bf7992643564511a}[SIP_Header_User-Agent]{MicroSIP/3.16.7}||0|2|8|0
    193738.119|command|cmd_AnswerCall|||||0|0|0|0
    193738.127|event|GCEV_OFFERED|10.1.1.76||10.1.1.59|[SIP_HDR_Request_URI]{sip:10.1.1.59}[SIP_HDR_Contact_URI]{sip:10.1.1.76:59761;ob}[SIP_HDR_CALLID]{3253bc02179c4d26bf7992643564511a}[SIP_HDR_FROM]{<sip:10.1.1.76>;tag=a58464dac8d94d918f1ea426c3655a02}[SIP_HDR_TO]{<sip:10.1.1.59>}[SIP_Header_Via]{SIP/2.0/UDP 10.1.1.76}[SIP_Header_From]{<sip}[SIP_Header_To]{<sip}[SIP_Header_Contact]{<sip}[SIP_Header_Call-ID]{3253bc02179c4d26bf7992643564511a}[SIP_Header_User-Agent]{MicroSIP/3.16.7}||2|0|8|0
    193738.188|event|GCEV_ANSWERED|||||2050|0|0|0
    193738.188|callstate|GCEV_ANSWERED|||||0|256|4|0
    193738.189|state|<offered> : cid=10.1.1.76 , dnis=10.1.1.59 connected|||||0|0|0|0
    193738.222|state|[Get Client ID] Number Input|||||0|0|0|0
    193738.238|state|[Get Client ID] Playing wav (PayGetId.wav)|||||0|0|0|0
...
    193752.703|callstate|GCEV_DISCONNECTED|||||0|16384|64|0
    193752.706|event|GCEV_DISCONNECTED|||||16384|0|64|0
    193752.741|event||LineEvCallState_DISCONNECTED||||0|0|0|0
    193752.741|command|cmd_DropCall|||||0|0|0|0
    193752.757|callstate|GCEV_DROPCALL|||||0|1|32|0
    193752.772|event|GCEV_DROPCALL|||||1|0|32|0
    193752.791|callstate|GCEV_RELEASECALL|GCST_NULL||||2137|0|0|0
  ",
  "length": "14.679"
}},

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×