Browse code

uac: also set socket for in dialog REGISTER (GH #2262)

Henning Westerholt authored on 24/03/2020 21:42:59
Showing 1 changed files
... ...
@@ -1131,6 +1131,19 @@ int uac_reg_update(reg_uac_t *reg, time_t tn)
1131 1131
 	/* Callback parameter */
1132 1132
 	uac_r.cbp = (void*)uuid;
1133 1133
 
1134
+	if(reg->socket.s != NULL && reg->socket.len > 0) {
1135
+		/* custom socket */
1136
+		LM_DBG("using custom socket %.*s to send request\n",
1137
+			reg->socket.len, reg->socket.s);
1138
+		uac_r.ssock = &reg->socket;
1139
+	} else {
1140
+		/* default socket */
1141
+		if(uac_default_socket.s != NULL && uac_default_socket.len > 0) {
1142
+			LM_DBG("using configured default_socket to send request\n");
1143
+			uac_r.ssock = &uac_default_socket;
1144
+		}
1145
+	}
1146
+
1134 1147
 	if (reg_keep_callid && reg->flags & UAC_REG_ONLINE
1135 1148
 				&& reg->cseq > 0 && reg->cseq < 2147483638
1136 1149
 				&& reg->callid.len > 0)
... ...
@@ -1150,19 +1163,6 @@ int uac_reg_update(reg_uac_t *reg, time_t tn)
1150 1150
 
1151 1151
 		ret = uac_tmb.t_request_within(&uac_r);
1152 1152
 	} else {
1153
-		/* custom socket */
1154
-		if(reg->socket.s != NULL && reg->socket.len > 0) {
1155
-			LM_DBG("using custom socket %.*s to send request\n",
1156
-				reg->socket.len, reg->socket.s);
1157
-			uac_r.ssock = &reg->socket;
1158
-		}
1159
-		/* default socket */
1160
-		else {
1161
-			if(uac_default_socket.s != NULL && uac_default_socket.len > 0) {
1162
-				LM_DBG("using configured default_socket to send request\n");
1163
-				uac_r.ssock = &uac_default_socket;
1164
-			}
1165
-		}
1166 1153
 		ret = uac_tmb.t_request(&uac_r,  /* UAC Req */
1167 1154
 				&s_ruri, /* Request-URI */
1168 1155
 				&s_turi, /* To */