Module: kamailio Branch: 5.5 Commit: 158f794d07890f0f237683ece880dd123be7dbbf URL: https://github.com/kamailio/kamailio/commit/158f794d07890f0f237683ece880dd12...
Author: Dennis Yurasov dennis-y@yandex-team.ru Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-10-25T14:49:36+02:00
uac: fixing REGISTER to use custom socket after 401/407
- After receiving 401/407 uac does not use configured custom socket, second register send from first available address.
(cherry picked from commit ea4d7fee43269ed50a55c444a0efdcc0dd64a95c)
---
Modified: src/modules/uac/uac_reg.c
---
Diff: https://github.com/kamailio/kamailio/commit/158f794d07890f0f237683ece880dd12... Patch: https://github.com/kamailio/kamailio/commit/158f794d07890f0f237683ece880dd12...
---
diff --git a/src/modules/uac/uac_reg.c b/src/modules/uac/uac_reg.c index c36ee8ac822..f96f1ca0614 100644 --- a/src/modules/uac/uac_reg.c +++ b/src/modules/uac/uac_reg.c @@ -1011,6 +1011,20 @@ void uac_reg_tm_callback( struct cell *t, int type, struct tmcb_params *ps) uac_r.cb = uac_reg_tm_callback; /* Callback parameter */ uac_r.cbp = (void*)uuid; + + if(ri->socket.s != NULL && ri->socket.len > 0) { + /* custom socket */ + LM_DBG("using custom socket %.*s to send request\n", + ri->socket.len, ri->socket.s); + uac_r.ssock = &ri->socket; + } else { + /* default socket */ + if(uac_default_socket.s != NULL && uac_default_socket.len > 0) { + LM_DBG("using configured default_socket to send request\n"); + uac_r.ssock = &uac_default_socket; + } + } + ret = uac_tmb.t_request_within(&uac_r);
if(ret<0) {