I have a unique dial plan where each call that comes in is checked by the caller id and then directed to a single ext for 2 rings then directed to a queue until someone answers. The redirection makes seeing the whole call in CDR/Queue logs difficult. I want to add to my dial plan custom logging statements so that I can capture the entire call path. I have considered using the System() application to call a script and store the data. Each time my dial plan directs a call I would write a new log via system. Has anyone had experience using the System() application in a dial plan and did it perform well? I am also open to any other suggestions to solve my problem.
If You’d like to see the callpath within one CDR this could be achieved by using different CDR-variables which get populated depending on the path (implies that You use a cdr-module like cdr_adaptive_odbc, I’ve implemented such solutions for customers).
Another approch would be usage of the ODBC-Function within Asterisk (not using the System-Command) to write data directly to an OFBC-connected ressource.
And - at least - when writing to a file is sufficient (for later asynch processing), You could use the function FILE to store the information (this is performant enough, we use this in extensive callpath-logging for a customer handling up to 1.000 parallel calls)
I think I can handle number 2 as I am already using the odbc functions for reading from a database. My concern is performance, if for any reason the database call hangs would that cause the dial plan to hang as well. I was hoping that I could use the system application to call a script and return immediately but still process the logging event without waiting for it to finish. Having the script crash and losing the logging event would be better then delaying the dial plan.
I was not able to find call event logging but I did find channel event logging and it looks like what I am trying to do. Also sorry for posting my question here, in the future I will post my support questions in the right place.