Skip to main content

1require("msys.core");
2
3local mod = {};
4
5function mod:smpp_log_reception(conn, msg, error)
6  print("sample_smpp_log_reception_hook received message with error: ", error);
7end
8
9msys.registerModule("smpp_hooks_test", mod);

1#include "module.h"
2#include "modules/mobility/smpp/hooks/smpp_logging.h"
3#include "modules/mobility/smpp/smpp.h"
4
5static void sample_smpp_log_reception_hook(void *closure, smpp_conn* conn, ec_message *m,
6  const char* error)
7{
8  printf("sample_smpp_log_reception_hook received message with error: %s\n", error);
9}
10
11static int init (generic_module_infrastructure *gself) {
12  struct mbl_config *conf = gself->module_private_data;
13
14  /* register the hook during module initialization */
15  register_smpp_log_reception_hook_first (sample_smpp_log_reception_hook, conf);
16  return 0;
17}
18
19EC_MODULE_EXPORT
20generic_module_infrastructure smpp_hook_test = {
21  {
22    EC_MODULE_INIT(EC_MODULE_TYPE_GENERIC, 0),
23    "smpp_hook_test.c",
24    "Sample SMPP Hook",
25    NULL,
26    NULL,
27    NULL,
28    init,
29    NULL,
30    NULL,
31    NULL,
32    NULL,
33    NULL
34  }
35};
Was this page helpful?