summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2014-03-01 10:27:24 +0100
committerAlfred E. Heggestad <aeh@db.org>2014-03-01 10:27:24 +0100
commit4adbad4d48698806ba88e777187a1e9905844b40 (patch)
treec777f5c1bd319d80f9585577db5bec497e3ef9d1
parent7aa9ed7b37d1b6e32b13b190242a48da2aff6e3c (diff)
dtmfio: fix whitespace and ccheck.py warnings
-rw-r--r--modules/dtmfio/dtmfio.c46
1 files changed, 21 insertions, 25 deletions
diff --git a/modules/dtmfio/dtmfio.c b/modules/dtmfio/dtmfio.c
index ccda000..10fdf43 100644
--- a/modules/dtmfio/dtmfio.c
+++ b/modules/dtmfio/dtmfio.c
@@ -52,8 +52,6 @@
* + Clean up build output so there aren't errors regarding unused vars
*/
-
-
#include <stdio.h>
#include <re.h>
#include <baresip.h>
@@ -65,27 +63,25 @@ static FILE *fd;
static const char *DTMF_OUT = "/tmp/dtmf.out";
-
-static int dtmf_handler(const struct call *call, int key, void *arg){
- if( key != 0 ) {
+static void dtmf_handler(struct call *call, char key, void *arg)
+{
+ if ( key != 0 ) {
fprintf(fd, "%c", key);
fflush(fd);
}
-
- return 0;
}
-static void ua_event_handler(struct ua *ua,
- enum ua_event ev,
- struct call *call,
- const char *prm,
- void *arg ) {
-
+static void ua_event_handler(struct ua *ua,
+ enum ua_event ev,
+ struct call *call,
+ const char *prm,
+ void *arg )
+{
if ( ev == UA_EVENT_CALL_ESTABLISHED ) {
fprintf(fd, "E");
fflush(fd);
- call_set_handlers( call, NULL, (call_dtmf_h*) dtmf_handler, NULL);
+ call_set_handlers( call, NULL, dtmf_handler, NULL);
}
if (ev == UA_EVENT_CALL_CLOSED ) {
@@ -97,27 +93,28 @@ static void ua_event_handler(struct ua *ua,
}
-
-static int module_init(void){
-
+static int module_init(void)
+{
uag_event_register( ua_event_handler, NULL );
-
- if( mkfifo( DTMF_OUT, S_IWUSR | S_IRUSR ) ) {
- error("Creation of the FIFO errored. This might cause issues.\n");
+
+ if ( mkfifo( DTMF_OUT, S_IWUSR | S_IRUSR ) ) {
+ error("Creation of the FIFO errored."
+ " This might cause issues.\n");
}
fd = fopen( DTMF_OUT , "w+" );
- if( fd == 0 ){
- error("Opening of the FIFO errored. This might cause issues.\n");
+ if ( fd == 0 ){
+ error("Opening of the FIFO errored."
+ " This might cause issues.\n");
}
return 0;
}
-static int module_close(void){
-
+static int module_close(void)
+{
fclose(fd);
unlink(DTMF_OUT);
@@ -132,4 +129,3 @@ const struct mod_export DECL_EXPORTS(dtmfio) = {
module_init,
module_close
};
-