The uac_redirect fails to load in 5.6. It used to load fine before. It is complaining about the acc API, which it never did before. I don't use the acc module and fail to see why uac_redirect would need it.
``` 2022-07-15T14:41:43.813169+02:00 pc1 proxy1[381424]: ERROR: uac_redirect [../../modules/acc/acc_api.h:191]: acc_load_api(): cannot find bind_acc 2022-07-15T14:41:43.813232+02:00 pc1 proxy1[381424]: ERROR: uac_redirect [uac_redirect.c:254]: redirect_init(): cannot bind to ACC API 2022-07-15T14:41:43.813283+02:00 pc1 proxy1[381424]: ERROR: <core> [core/sr_module.c:971]: init_mod(): Error while initializing module uac_redirect (/usr/lib/x86_64-linux-gnu/kamailio/modules/uac_redirect.so)
```
It seems some conditions were lost on a code update. Can you try with the commit referenced above?
That fixed it. Thanks.
Should probably be backported to 5.6.
Sorry, tested the wrong binary. The problem is not fixed.
`uacred_acc_fct_s.s==0` is true by default, so the check does nothing to restore previous behaviour.
As docs say:
4.4. acc_function (string)
Specifies the accounting function to be used. Just by defining this parameter, the **accounting support will not be enabled**. ```
Reverting a0ef1ccd1736 fixes the issue completely.
@gaaf Thanks. It seems that a0ef1ccd1 needs some more fixes. Its "only" a refactoring, but the previous way how the module work was using a non-standard way. The module should keep working, of course.
@gaaf: have you set the `acc_param` function to empty string? The condition is also with `uacred_acc_fct_s.s[0] != '\0'`.
In 5.5, the condition was similar, snippet next:
``` if(rd_acc_fct == 0) { /* import the acc stuff */ if(acc_fct_s != 0 && acc_fct_s[0] == '\0') { fct = find_export(acc_fct_s, 2, REQUEST_ROUTE); if(fct == 0) fct = find_export(acc_fct_s, 1, REQUEST_ROUTE); if(fct == 0) { LM_ERR("cannot import %s function; is acc loaded and" " configured\n", acc_fct_s); return E_UNSPEC; } rd_acc_fct = fct; } } ```
The `acc_fct_s` was renamed to `uacred_acc_fct_s` in 5.6.
Analysing the snippet in previous comment, there is a bug obviously, probably the acc function was looked up by the fixup function, not by mod init -- in the `get_redirect_fixup()` function the condition is:
``` /* must import the acc stuff */ if (acc_fct_s==0 || acc_fct_s[0]==0) { LM_ERR("acc support enabled, but no acc function defined\n"); return E_UNSPEC; } ``` So, the bug could have been the reason to not require empty value for acc function parameter to disable acc.
@gaaf: have you set the `acc_param` function to empty string?
No. The config is identical to the 5.4 version, where is also wasn't set.
That was a behaviour due to a mistake, respectively the IF had the condition **if function name pointer is not null and first character is `\0`** -- practically on empty string was trying to find the acc function with empty string name:
``` /* import the acc stuff */ if(acc_fct_s != 0 && acc_fct_s[0] == '\0') { fct = find_export(acc_fct_s, 2, REQUEST_ROUTE); ``` Obviously it was supposed to find the acc function when the name was not null and not empty string. The new version of the module fixed the mistake and the function name has to be set to emtpy string via modparam.
If that does not work, reopen.
Closed #3188 as completed.
Hello, I still have same issue. kamailio 5.6.4.
Can we re-open this issue please ? Or I should create new one ?
Mar 30 10:35:26 kam1 kamailio[12610]: ERROR: uac_redirect [../../modules/acc/acc_api.h:191]: acc_load_api(): cannot find bind_acc Mar 30 10:35:26 kam1 kamailio[12610]: ERROR: uac_redirect [uac_redirect.c:259]: redirect_init(): cannot bind to ACC API Mar 30 10:35:26 kam1 kamailio[12610]: ERROR: <core> [core/sr_module.c:974]: init_mod(): Error while initializing module uac_redirect (/usr/lib/x86_64-linux-gnu/kamailio/modules/uac_redirect.so)
Discuss first on sr-users mailing list providing further details, such as modparams, logs with debug=3, and if it proves to be some code error, a new issue can be created. But not before.