Add Masquerade manager event which trips when a masquerade happens (issue #7840 repor...
[asterisk/asterisk.git] / funcs / func_callerid.c
index 03a6535..6068739 100644 (file)
  * 
  */
 
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
 
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/module.h"
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
@@ -58,7 +59,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
 
                        ast_copy_string(buf, num, len);
                } else {
-                       ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+                       ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
                }
        } else {
                if (!strncasecmp("all", data, 3)) {
@@ -87,7 +88,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
                                ast_copy_string(buf, chan->cid.cid_rdnis, len);
                        }
                } else {
-                       ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+                       ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
                }
        }
 
@@ -124,7 +125,7 @@ static int callerid_write(struct ast_channel *chan, char *cmd, char *data,
                        free(chan->cid.cid_rdnis);
                chan->cid.cid_rdnis = ast_strdup(value);
        } else {
-               ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+               ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
        }
 
        return 0;
@@ -142,26 +143,14 @@ static struct ast_custom_function callerid_function = {
        .write = callerid_write,
 };
 
-static char *tdesc = "Caller ID related dialplan function";
-
-static int unload_module(void *mod)
+static int unload_module(void)
 {
        return ast_custom_function_unregister(&callerid_function);
 }
 
-static int load_module(void *mod)
+static int load_module(void)
 {
        return ast_custom_function_register(&callerid_function);
 }
 
-static const char *description(void)
-{
-       return tdesc;
-}
-
-static const char *key(void)
-{
-       return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1 | NO_USECOUNT, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Caller ID related dialplan function");