(fwd) Re: vgetty for non-recording ... (fwd)

Alexander Wiedeck (alexander.wiedeck@ku-eichstaett.de)
26 Jan 1999 1917:55:37 GMT


Hi,

On Sat, 23 Jan 1999, Marc SCHAEFER wrote:

MS>On Sat, 23 Jan 1999, Marc SCHAEFER wrote:
MS>
MS>>
MS>> > hades% diff --rcs answer.c answer.new.c
MS>>
MS>> patch integrated into mgetty-CURRENT. Presumably in the next
MS>> release (1.1.21).
MS>
MS>only change: I use *max* len and not *min* len.

Thanks very much Marc!

Well, using the answering machine (it is for people informing theirselfs,
like fax-polling service) I found out for the provider it is very
interesting how long the caller was listening. I could parse the logfile
for the beginning and the end of the call but mgetty/vgetty provides
that nice #####-line. Perhaps it could be a good idea to include playtime
there, Marc?

I imagine that as follows:

-------------------------- snap ---------------------------------
--- answer.old.c	Sun Jan 24 18:35:01 1999
+++ answer.c	Sun Jan 24 18:38:39 1999
@@ -459,11 +459,15 @@
 
           };
 
+     
+     time(&call_start);
      if (voice_play_file(greeting_message) == FAIL)
           {
           lprintf(L_WARN, "%s: Could not play greeting message",
            program_name);
           }
+     time(&call_end);
+     call_length = call_end - call_start;
 
      if ((execute_dtmf_script) && (strlen(cvd.dtmf_program.d.p) != 0))
           {
@@ -505,9 +509,10 @@
 
      if (hangup_requested)
           {
-          lprintf(L_AUDIT,
-           "hangup requested, name='%s', caller=%s, dev=%s, pid=%d",
-           CallName, CallerId, DevID, getpid());
+	  lprintf(L_AUDIT,
+	   "hangup requested, length=%02d:%02d:%02d, name='%s', caller=%s, dev=%s, pid=%d",
+           (int) (call_length / 3600), (int) ((call_length / 60) % 60),
+           (int) (call_length % 60), CallName, CallerId, DevID, getpid());
 
           if (voice_set_device(NO_DEVICE) == FAIL)
                {
-------------------------- snap ---------------------------------

Or something like that. I did NOT analyzed the/your program-code good
enough (I'm sure the 'patch' is incomplete) so you can call the lines
above pseudo-code.
Please tell me what you think about.

  aleX
-- 
Alexander Wiedeck...............alexander.wiedeck@ku-eichstaett.de
Key fingerprint = 02 C9 F8 08 1A 36 F9 D0  22 6C 4C 4F 06 78 34 C3
Old  programmers  never die,   they just branch to a new  address.