Browse code

uac: uac_auth() and uac_req_send() exported to kemi framework

Daniel-Constantin Mierla authored on 01/05/2017 06:07:03
Showing 3 changed files
... ...
@@ -47,6 +47,7 @@
47 47
 #include "../../modules/tm/tm_load.h"
48 48
 #include "../../modules/tm/t_hooks.h"
49 49
 #include "../../core/mod_fix.h"
50
+#include "../../core/kemi.h"
50 51
 #include "../../core/rpc.h"
51 52
 #include "../../core/rpc_lookup.h"
52 53
 #include "../../core/cfg/cfg_struct.h"
... ...
@@ -550,6 +551,10 @@ static int w_uac_auth(struct sip_msg* msg, char* str, char* str2)
550 551
 	return (uac_auth(msg)==0)?1:-1;
551 552
 }
552 553
 
554
+static int ki_uac_auth(struct sip_msg* msg)
555
+{
556
+	return (uac_auth(msg)==0)?1:-1;
557
+}
553 558
 
554 559
 static int w_uac_reg_lookup(struct sip_msg* msg,  char* src, char* dst)
555 560
 {
... ...
@@ -639,3 +644,32 @@ int bind_uac(uac_api_t *uacb)
639 644
 	uacb->req_send = uac_req_send;
640 645
 	return 0;
641 646
 }
647
+
648
+/**
649
+ *
650
+ */
651
+/* clang-format off */
652
+static sr_kemi_t sr_kemi_uac_exports[] = {
653
+	{ str_init("uac"), str_init("uac_auth"),
654
+		SR_KEMIP_INT, ki_uac_auth,
655
+		{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
656
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
657
+	},
658
+	{ str_init("uac"), str_init("uac_req_send"),
659
+		SR_KEMIP_INT, ki_uac_req_send,
660
+		{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
661
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
662
+	},
663
+
664
+	{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
665
+};
666
+/* clang-format on */
667
+
668
+/**
669
+ *
670
+ */
671
+int mod_register(char *path, int *dlflags, void *p1, void *p2)
672
+{
673
+	sr_kemi_modules_add(sr_kemi_uac_exports);
674
+	return 0;
675
+}
642 676
\ No newline at end of file
... ...
@@ -819,3 +819,8 @@ int w_uac_req_send(struct sip_msg *msg, char *s1, char *s2)
819 819
 {
820 820
 	return uac_req_send();
821 821
 }
822
+
823
+int ki_uac_req_send(sip_msg_t *msg)
824
+{
825
+	return uac_req_send();
826
+}
822 827
\ No newline at end of file
... ...
@@ -31,5 +31,6 @@ int pv_parse_uac_req_name(pv_spec_p sp, str *in);
31 31
 void uac_req_init(void);
32 32
 int uac_req_send(void);
33 33
 int w_uac_req_send(struct sip_msg *msg, char *s1, char *s2);
34
+int ki_uac_req_send(sip_msg_t *msg);
34 35
 
35 36
 #endif