Module: kamailio
Branch: master
Commit: e21df35840c7a85cf26a3005f718e5e37edeac8e
URL:
https://github.com/kamailio/kamailio/commit/e21df35840c7a85cf26a3005f718e5e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-07-18T08:37:48+02:00
uac_redirect: test if the acc function is set before binding to acc module
- GH #3188
---
Modified: src/modules/uac_redirect/uac_redirect.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e21df35840c7a85cf26a3005f718e5e…
Patch:
https://github.com/kamailio/kamailio/commit/e21df35840c7a85cf26a3005f718e5e…
---
diff --git a/src/modules/uac_redirect/uac_redirect.c
b/src/modules/uac_redirect/uac_redirect.c
index 1fd06c5b723..76b7592b5af 100644
--- a/src/modules/uac_redirect/uac_redirect.c
+++ b/src/modules/uac_redirect/uac_redirect.c
@@ -166,6 +166,10 @@ static int get_redirect_fixup(void** param, int param_no)
*param=(void*)(long)( (((unsigned short)maxt)<<8) | maxb);
} else if (param_no==2) {
/* acc function loaded? */
+ if (uacred_acc_fct_s.s==0 || uacred_acc_fct_s.s[0]=='\0') {
+ LM_ERR("acc support enabled, but no acc function defined\n");
+ return E_UNSPEC;
+ }
if (_uacred_accb.acc_request==NULL) {
/* bind the ACC API */
if(acc_load_api(&_uacred_accb) < 0) {
@@ -249,10 +253,12 @@ static int redirect_init(void)
goto error;
}
- /* bind the ACC API */
- if(acc_load_api(&_uacred_accb) < 0) {
- LM_ERR("cannot bind to ACC API\n");
- return -1;
+ if(uacred_acc_fct_s.s != 0 && uacred_acc_fct_s.s[0] != '\0') {
+ /* bind the ACC API */
+ if(acc_load_api(&_uacred_accb) < 0) {
+ LM_ERR("cannot bind to ACC API\n");
+ return -1;
+ }
}
/* init filter */