gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] Additional programs and language bindings branch, master, updated.


From: Daniele Forsi
Subject: [SCM] Additional programs and language bindings branch, master, updated. d0e79857da52f12a226b1d8ac1904035882b7bc5
Date: Mon, 06 Jan 2014 17:26:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Additional programs and language bindings".

The branch, master has been updated
       via  d0e79857da52f12a226b1d8ac1904035882b7bc5 (commit)
      from  38cb928c362643e8581ac75018253eca02e85460 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii/gnokii-extras.git/commit/?id=d0e79857da52f12a226b1d8ac1904035882b7bc5


commit d0e79857da52f12a226b1d8ac1904035882b7bc5
Author: Daniele Forsi <address@hidden>
Date:   Mon Jan 6 18:25:44 2014 +0100

    Add --ignore option to waitcall.c
    
    Useful for testing.

diff --git a/snippets/ChangeLog b/snippets/ChangeLog
index 69d209d..87b95eb 100644
--- a/snippets/ChangeLog
+++ b/snippets/ChangeLog
@@ -1,3 +1,7 @@
+2014/01/06
+ * monitor/
+    o add --ignore option to waitcall.c                      (Daniele Forsi)
+
 2012/03/24
  * monitor/
     o fix compiler warning in cellid.c                       (Daniele Forsi)
diff --git a/snippets/monitor/waitcall.c b/snippets/monitor/waitcall.c
index 68192b7..0930574 100644
--- a/snippets/monitor/waitcall.c
+++ b/snippets/monitor/waitcall.c
@@ -58,6 +58,7 @@ done
 #define WAITCALL_ANSWER 1
 #define WAITCALL_HANGUP 2
 #define WAITCALL_EXIT 3
+#define WAITCALL_IGNORE 4
 
 struct gn_statemachine *state = NULL;
 int quit = 0;
@@ -96,7 +97,6 @@ void incoming_call(int lowlevel_id, char *number) {
        
        printf("%s\n", number);
        call_detected = lowlevel_id;
-       quit = 1;
 }
 
 gn_error hangup(int lowlevel_id) {
@@ -157,6 +157,8 @@ int main(int argc, char *argv[]) {
                        action = WAITCALL_ANSWER;
                } else if (!strcmp(argv[1], "--exit")) {
                        action = WAITCALL_EXIT;
+               } else if (!strcmp(argv[1], "--ignore")) {
+                       action = WAITCALL_IGNORE;
                } else {
                        action = WAITCALL_ERROR;
                }
@@ -166,8 +168,8 @@ int main(int argc, char *argv[]) {
        }
 
        if (action == WAITCALL_ERROR) {
-               fprintf(stderr, _("waitcall 0.6 by Daniele Forsi\n"));
-               fprintf(stderr, _("Usage: %s [--hangup|--answer|--exit]\n"), 
argv[0]);
+               fprintf(stderr, _("waitcall 0.7 by Daniele Forsi\n"));
+               fprintf(stderr, _("Usage: %s 
[--hangup|--answer|--exit|--ignore]\n"), argv[0]);
                fprintf(stderr, _("Purpose: wait for a call, print caller 
number to stdout, optionally hang up or answer, then exit\n"));
                fprintf(stderr, _("Default action is --hangup\n"));
                exit(1);
@@ -219,6 +221,7 @@ int main(int argc, char *argv[]) {
                        } else {
                                fprintf(stderr, _("Hang up ok\n"));
                        }
+                       quit = 1;
                        break;
                case WAITCALL_ANSWER:
                        error = answer(call_detected);
@@ -227,9 +230,14 @@ int main(int argc, char *argv[]) {
                        } else {
                                fprintf(stderr, _("Answer ok\n"));
                        }
+                       quit = 1;
                        break;
                case WAITCALL_EXIT:
                        fprintf(stderr, _("Exit ok\n"));
+                       quit = 1;
+                       break;
+               case WAITCALL_IGNORE:
+                       fprintf(stderr, _("Waiting for a call.\n"));
                        break;
                }
        }
diff --git a/snippets/monitor/waitcall.readme b/snippets/monitor/waitcall.readme
index d49afcc..c7f7157 100644
--- a/snippets/monitor/waitcall.readme
+++ b/snippets/monitor/waitcall.readme
@@ -1,12 +1,13 @@
 $Id$
 
 An utility program that using libgnokii waits for a call, prints caller
-number to stdout, optionally hangs up or answers, then exits.
+number to stdout, optionally hangs up or answers, then exits or waits again.
 
 The --hangup argument means hanging up the incoming call as soon as possible
 after the first ring (this is the default action).
 The --answer argument implements an "auto answer" after the first ring.
 The --exit argument means exiting without hanging up or answering.
+The --ignore argument means just print number and continue.
 The caller number is always printed, if present.
 
 Example:

-----------------------------------------------------------------------

Summary of changes:
 snippets/ChangeLog               |    4 ++++
 snippets/monitor/waitcall.c      |   14 +++++++++++---
 snippets/monitor/waitcall.readme |    3 ++-
 3 files changed, 17 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Additional programs and language bindings



reply via email to

[Prev in Thread] Current Thread [Next in Thread]