When using uac_reg_request_to and the first trunk fails (as invalid credentials) try a second trunk, but there is something not cleaned or just doesn't get the new trunk auth params.
code example ``` failure_route[RETRY_OUTBOUND] {
if (t_check_status("401|407")) { if(uac_reg_request_to("$rd", 0)) { t_on_failure("RETRY_OUTBOUND"); xinfo("[RETRY_OUTBOUND] <$ci> | Doing authentication with $dd"); uac_auth(); t_relay(); exit; } }
if (next_routing()) { $avp(out_trunk) = $rd; # t_relay(); t_on_failure("RETRY_OUTBOUND"); t_relay(); exit; } }
```
running this code to those targets: - TRUNK 10.3.3.11 (invalid user/pass) - TRUNK 10.3.3.12 (correct user/pass)
produce this output in logs: ``` INFO: [RETRY_OUTBOUND] <xxxx1xxx@10.3.3.11:5060> | Doing authentication with 10.3.3.10 INFO: uac [auth.c:450]: uac_auth_mode(): no credential for realm "10.3.3.11" INFO: [RETRY_OUTBOUND] <xxxx1yyyy@10.3.3.12:5060> | Doing authentication with 10.3.3.10 ```
but if I simply remove the first trunk those credential works on the second trunk. is like some stuff (like the $dd) is not cleaned up / refreshed?
version: ``` version: kamailio 5.5.4 (x86_64/linux) flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: unknown compiled with gcc 8.3.0 ``` running with drouting module to get next trunk
Closed #3166 as completed.
For questions about how to use Kamailio and its configuration file, you have to send email to [sr-users@lists.kamailio.org](mailto:sr-users@lists.kamailio.org) . The bug tracker is for reporting issues in the code.