Module: kamailio Branch: master Commit: 306489e82ae37ab3788808745a465ef438fb929f URL: https://github.com/kamailio/kamailio/commit/306489e82ae37ab3788808745a465ef4...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: GitHub noreply@github.com Date: 2021-10-25T14:31:24+02:00
Merge pull request #2902 from Den4t/master
uac: fixing REGISTER to use custom socket after 401/407
---
Modified: src/modules/uac/uac_reg.c
---
Diff: https://github.com/kamailio/kamailio/commit/306489e82ae37ab3788808745a465ef4... Patch: https://github.com/kamailio/kamailio/commit/306489e82ae37ab3788808745a465ef4...
---
diff --git a/src/modules/uac/uac_reg.c b/src/modules/uac/uac_reg.c index 1ea1b62135..85fe266c92 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) {