|Summary:||ASTERISK-05280: [patch] Move automated dial out call files into a "done" directory instead of delete them|
|Reporter:||Ezio Vernacotola (ezio)||Labels:|
|Date Opened:||2005-10-11 17:02:37||Date Closed:||2006-05-25 13:00:45|
|Environment:||Attachments:||( 0) autocall|
( 1) pbx_spool.patch9
( 2) README.callfiles.2
( 3) README.callfiles.3
|Description:||Calls files are actually deleted after asterisk process them. Is not easy know if the call was successfully delivered or not. One solution is look into cdr files or use manager interface.|
This patch move the call file into a "outgoing.done" dir, appending a "Status:" line with "Completed", "Expired" or "Failed".
Il the call was completed is appended a line "Uniquecallid: xxx" too.
****** ADDITIONAL INFORMATION ******
With this patch is very easy submit one or more outgoing call jobs and see later what happened. It's possible add to the call file user defined fields (eg "JobId: 123456") , that are ignored by asterisk, but are preserved after them are proccessed.
|Comments:||By: Russell Bryant (russell) 2005-10-11 17:21:07|
Does this patch make this feature optional?
Generally, if you require monitoring of call progress, the manager interface is better suited for your needs.
By: twisted (twisted) 2005-10-11 19:59:43
this patch does not make it optional. Perhaps we could either make it a run-time option, or a call-time option with YAVKP (yet another value-key-pair) within the call file.
By: Ezio Vernacotola (ezio) 2005-10-12 07:00:00
I missed make the feature optional and keeping the current behaviour by default.
The manager interface can do the job, but the spool interface has very often all what is needed, and without keeping somewhere another process up and running. Another point is that the spool has already a simple but effective retry logic that with the manager is left to the external application.
To make the feature optional what about a "AfterDone: [archive|delete]" keypair in the call file? Or "ArchiveDir: <archdir>" where archdir must have no path info and is created if doesn't not exists by asterisk as subdir of a predefined location?
By: twisted (twisted) 2005-10-12 15:40:57
Sounds good to me.
By: Ezio Vernacotola (ezio) 2005-10-14 10:02:39
In pbx_spool.patch3 I made the feature optional by a key "Archive" in call file, with possible values no (default) or yes. If "Archive: yes" the call file is moved into the subdir "outgoing_done" of the asterisk spool dir. This subdir is created only when necessary.
Unknown call file keys that begin with "X-" don't generate warnings. If the call file is archived it is possible store in that keys any useful information, eg: "X-JobId: xxx" (yes, it's possible use comments too, but this seems to me more clear).
The choice of the archive subdir and call file key names may be not be very nice, because I don't use English language currently, anyone may suggest something better.
By: Olle Johansson (oej) 2005-11-22 11:04:56.000-0600
Does this patch still apply to current CVS?
By: Ezio Vernacotola (ezio) 2005-11-22 17:20:08.000-0600
The patched version of pbx_spool.c merged with no conflicts with the recent updates. In pbx_spool.patch4 however there is the diff against current cvs (head) version.
As sample usage "autocall" is the python xmlrpc cgi script that I currently use to submit call jobs and retreive their status. It defines two procedures:
"putcall(Channel, CallerId, MaxRetries, RetryTime, WaitTime, Context, Extension, Priority, JobId, StartTime)" submits a call returning the filename in the spool dir
"getcallstatus(callfn)" returns the status ([Completed, Expired, Failed]) of the call given the call filename
By: Ezio Vernacotola (ezio) 2005-11-24 09:43:16.000-0600
bug 0003583 is a totally different thing (pbx_spool vs sip configuration). There is a mistake in the related to relationships.
By: Olle Johansson (oej) 2005-11-24 09:47:31.000-0600
Please document the new option in sample.call
By: Olle Johansson (oej) 2005-11-24 09:50:21.000-0600
What's the idea with the "x-*" option checking?
By: Ezio Vernacotola (ezio) 2005-11-24 11:08:49.000-0600
pbx_spool.patch5 includes the comments to sample.call.
The idea about the X-* check is that I was initially putting "JobId: xxx" in my calls file, so when I look later in the outgoing_done dir it can be identified within the automated process used to generate the call. This was not very good because of the "Unknown keyword" warning in the log.
So I removed the keyword check for a formatted key-value pair that begins with X-, leaving the user to write, in formatted way, any additional info without interfere with the spooling process.
Possible alternatives are use only the filename as the identifier of the call job, and store additional data away, or use comments, but this seems me to be more general.
By: Olle Johansson (oej) 2005-11-24 11:10:57.000-0600
You need to document all changes in your patch in the tracker, please :-)
Time to write a README.callfiles I believe.
By: Ezio Vernacotola (ezio) 2005-12-02 03:01:34.000-0600
Thanks for your interest oej, is not easy for me write in english, and write the readme may take me some time. However the matter is rather simple, and I think that is not bad copy and paste some stuff from the wiki.
In the patch I replaced anywhere there was "unlink(callfile)" with "remove_from_queue(o, reason, uniquecallid)". This new function take care of unlink the callfile if the field "Archive" is missing or "no", or move the callfile in the archive dir if "Archive" is "yes". In the latter case is appended to the callfile a row with the exit status, "Status: <reason>" where reason is "Completed", "Failed" or "Expired", and id the call was completed a row with the unique call id. I don't understand well what you mean by document the changes in tracker, you think that I should put more comments in the source code?
I'm using this patch from a month from now to call every day 80 of our new customers to notify they that their subscription to our service was activated. The customer listen a message, and at end can press a key if she/he wants to talk with a our operator. In this case the dialplan make a "Dial" to send the call to a call center queue.
The interface between asterisk and the application program relies to a small xmlrpc cgi program written in python, launched from the http server (apache). The application program is written in delphi, runs on windows, and use a mssql server as database. In delphi I use the free dxmlrpc library to put a call in the spooling queue and monitor the status of the calls already spooled.
By: Matt O'Gorman (mogorman) 2006-01-12 17:00:25.000-0600
yay or nay?
By: Ezio Vernacotola (ezio) 2006-01-13 01:23:20.000-0600
In pbx_spool.patch6 the diff vs current svn trunk, with little doxygen documentation added, but I can't provide a readme.callfiles now
By: opsys (opsys) 2006-02-05 23:17:58.000-0600
HOUSEKEEPING AND PRODDING!!
Ezio, I understand you are having a hard time with the REAMDE file. What is your native language? We may be able to find someone to translate it and then we can edit and correct it further.
By: Ezio Vernacotola (ezio) 2006-02-06 16:21:07.000-0600
Ok, now I am at 90% done with the readme, in english. Yust another day or two to finish and pass it to my english spell checker :)
By: Tilghman Lesher (tilghman) 2006-04-11 19:16:31
Your "archive" option should be using ast_true(), not manual comparison to "yes" or "no". This makes it consistent with options in other files.
In terms of the X- options, they're completely unnecessary, as an equivalent note can be achieved simply by prefixing your notation with a '#' comment delimiter.
By: Ezio Vernacotola (ezio) 2006-04-17 13:43:19
Now "archive" option is tested with ast_true() and "X-" prefixed options are gone away.
NOTE: after changes of ast_pbx_outgoing_app in rev 9581 of pbx.c I cannot be able anymore to obtain the uniqueid of the call and save this value in the archived call file. If someone is interested in suggest me a solution I will try, else I'll remove the uniqueid related code and related info from the readme
By: Serge Vecher (serge-v) 2006-05-08 00:20:02
ezio: waiting for an updated patch here ...
By: Ezio Vernacotola (ezio) 2006-05-08 15:02:51
In pbx_spool.patch8 I removed the code that generated "Uniqueid:" info archived call file if the call was completed because after changes in ast_pbx_outgoing_app() I can't make it work anymore.
I removed info regarding "Uniqueid:" in README.callfiles.2 too.
By: Jeffrey C. Ollie (jcollie) 2006-05-19 16:04:54
I'm wondering if there isn't some way to combine the features requested in 6750 and 5426...
By: Ezio Vernacotola (ezio) 2006-05-24 15:28:52
In pbx_spool.patch9 I merged changes from ASTERISK-6572 and now in trunk
By: Leif Madsen (lmadsen) 2006-05-25 12:54:10
Read through the README.callfiles.2 file and made some minor changes. Find attached at README.callfiles.3.
By: Joshua C. Colp (jcolp) 2006-05-25 13:00:42
Put into trunk as of revision 30299, thanks to all involved!