Module: kamailio
Branch: master
Commit: f4d8235e5da98e7b99fdc1431505b44ee1672f63
URL:
https://github.com/kamailio/kamailio/commit/f4d8235e5da98e7b99fdc1431505b44…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2023-10-31T12:21:10+01:00
secsipid: fix build errors for older versions of secsipid lib
---
Modified: src/modules/secsipid/secsipid_mod.c
Modified: src/modules/secsipid_proc/secsipid_proc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f4d8235e5da98e7b99fdc1431505b44…
Patch:
https://github.com/kamailio/kamailio/commit/f4d8235e5da98e7b99fdc1431505b44…
---
diff --git a/src/modules/secsipid/secsipid_mod.c b/src/modules/secsipid/secsipid_mod.c
index ee169b3154c..b8c80382ac1 100644
--- a/src/modules/secsipid/secsipid_mod.c
+++ b/src/modules/secsipid/secsipid_mod.c
@@ -750,6 +750,7 @@ static int w_secsipid_sign(
static int ki_secsipid_sign_prvkey(
sip_msg_t *msg, str *sheaders, str *spayload, str *keydata)
{
+#if SECSIPID_VERSION >= 0x1030000
str ibody = STR_NULL;
if(secsipid_libopt_list_used == 0) {
@@ -776,7 +777,6 @@ static int ki_secsipid_sign_prvkey(
free(_secsipid_data.value.s);
}
_secsipid_data.value = ibody;
-
return 1;
error:
@@ -784,6 +784,10 @@ static int ki_secsipid_sign_prvkey(
free(ibody.s);
}
return -1;
+#else
+ LM_ERR("secsipid < 1.3.0, SecSIPIDSignJSONHPPrvKey not supported\n");
+ return -1;
+#endif
}
/**
diff --git a/src/modules/secsipid_proc/secsipid_proc_mod.c
b/src/modules/secsipid_proc/secsipid_proc_mod.c
index 82aaac33ea1..02a8b6eb44e 100644
--- a/src/modules/secsipid_proc/secsipid_proc_mod.c
+++ b/src/modules/secsipid_proc/secsipid_proc_mod.c
@@ -38,7 +38,9 @@ MODULE_VERSION
int secsipid_proc_bind(secsipid_papi_t *papi)
{
papi->SecSIPIDSignJSONHP = SecSIPIDSignJSONHP;
+#if SECSIPID_VERSION >= 0x1030000
papi->SecSIPIDSignJSONHPPrvKey = SecSIPIDSignJSONHPPrvKey;
+#endif
papi->SecSIPIDGetIdentity = SecSIPIDGetIdentity;
papi->SecSIPIDGetIdentityPrvKey = SecSIPIDGetIdentityPrvKey;
papi->SecSIPIDCheck = SecSIPIDCheck;