Module: kamailio
Branch: master
Commit: 73e9139c5246d3882474d8c9c613105bcbc6d90a
URL:
https://github.com/kamailio/kamailio/commit/73e9139c5246d3882474d8c9c613105…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-12-07T15:05:54+01:00
sca: exported functions to kemi framework
---
Modified: src/modules/sca/sca.c
Modified: src/modules/sca/sca_subscribe.c
Modified: src/modules/sca/sca_subscribe.h
---
Diff:
https://github.com/kamailio/kamailio/commit/73e9139c5246d3882474d8c9c613105…
Patch:
https://github.com/kamailio/kamailio/commit/73e9139c5246d3882474d8c9c613105…
---
diff --git a/src/modules/sca/sca.c b/src/modules/sca/sca.c
index f1dae14cb6..14dbf78ecb 100644
--- a/src/modules/sca/sca.c
+++ b/src/modules/sca/sca.c
@@ -41,6 +41,7 @@
#include "../../core/timer.h"
#include "../../core/timer_proc.h"
#include "../../core/mod_fix.h"
+#include "../../core/kemi.h"
#include "sca.h"
#include "sca_appearance.h"
@@ -479,6 +480,19 @@ static int sca_call_info_update_3_f(sip_msg_t* msg,
return sca_call_info_update(msg, update_mask, &uri_to, &uri_from);
}
+int ki_sca_call_info_update_default(sip_msg_t *msg)
+{
+ return sca_call_info_update(msg, SCA_CALL_INFO_SHARED_BOTH, NULL, NULL);
+}
+int ki_sca_call_info_update_mask(sip_msg_t *msg, int umask)
+{
+ return sca_call_info_update(msg, umask, NULL, NULL);
+}
+int ki_sca_call_info_update_turi(sip_msg_t *msg, int umask, str *sto)
+{
+ return sca_call_info_update(msg, umask, sto, NULL);
+}
+
int fixup_ciu(void **param, int param_no)
{
switch (param_no) {
@@ -504,3 +518,44 @@ int fixup_free_ciu(void **param, int param_no)
return E_UNSPEC;
}
}
+
+/**
+ *
+ */
+/* clang-format off */
+static sr_kemi_t sr_kemi_sca_exports[] = {
+ { str_init("sca"), str_init("handle_subscribe"),
+ SR_KEMIP_INT, ki_sca_handle_subscribe,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("sca"), str_init("call_info_update_default"),
+ SR_KEMIP_INT, ki_sca_call_info_update_default,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("sca"), str_init("call_info_update_mask"),
+ SR_KEMIP_INT, ki_sca_call_info_update_mask,
+ { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("sca"), str_init("call_info_update_turi"),
+ SR_KEMIP_INT, ki_sca_call_info_update_turi,
+ { SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("sca"), str_init("call_info_update"),
+ SR_KEMIP_INT, sca_call_info_update,
+ { SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_STR,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+
+ { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
+};
+/* clang-format on */
+
+int mod_register(char *path, int *dlflags, void *p1, void *p2)
+{
+ sr_kemi_modules_add(sr_kemi_sca_exports);
+ return 0;
+}
\ No newline at end of file
diff --git a/src/modules/sca/sca_subscribe.c b/src/modules/sca/sca_subscribe.c
index 48b0d58870..8040d49aab 100644
--- a/src/modules/sca/sca_subscribe.c
+++ b/src/modules/sca/sca_subscribe.c
@@ -1135,7 +1135,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int
event_type,
return (-1);
}
-int sca_handle_subscribe(sip_msg_t *msg, char *p1, char *p2)
+int ki_sca_handle_subscribe(sip_msg_t *msg)
{
sca_subscription req_sub;
sca_subscription *sub = NULL;
@@ -1354,6 +1354,11 @@ int sca_handle_subscribe(sip_msg_t *msg, char *p1, char *p2)
return (rc);
}
+int sca_handle_subscribe(sip_msg_t *msg, char *p1, char *p2)
+{
+ return ki_sca_handle_subscribe(msg);
+}
+
int sca_subscription_reply(sca_mod *scam, int status_code, char *status_msg,
int event_type, int expires, sip_msg_t *msg)
{
diff --git a/src/modules/sca/sca_subscribe.h b/src/modules/sca/sca_subscribe.h
index 2ef56d53da..e91971756e 100644
--- a/src/modules/sca/sca_subscribe.h
+++ b/src/modules/sca/sca_subscribe.h
@@ -88,5 +88,6 @@ void sca_subscription_state_to_str(int, str *);
int sca_subscription_aor_has_subscribers(int, str *);
int sca_subscription_delete_subscriber_for_event(sca_mod *, str *, str *, str *);
int sca_subscription_terminate(sca_mod *, str *, int, str *, int, int);
+int ki_sca_handle_subscribe(sip_msg_t *msg);
#endif // SCA_SUBSCRIBE_H