Fixed Service-Route update upon registration (#3823)

This commit is contained in:
sauwming 2024-01-10 16:55:23 +08:00 committed by GitHub
parent 26bdf998f0
commit 19c018affd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -2002,7 +2002,7 @@ static void update_service_route(pjsua_acc *acc, pjsip_rx_data *rdata)
pj_size_t rcnt;
/* Find and parse Service-Route headers */
for (;;) {
for (;(rdata);) {
char saved;
int parsed_len;
@ -2054,9 +2054,6 @@ static void update_service_route(pjsua_acc *acc, pjsip_rx_data *rdata)
break;
}
if (uri_cnt == 0)
return;
/*
* Update account's route set
*/
@ -2416,6 +2413,9 @@ static void regc_cb(struct pjsip_regc_cbparam *param)
(int)param->reason.slen, param->reason.ptr));
destroy_regc(acc, PJ_TRUE);
/* Clear Service-Route header */
update_service_route(acc, NULL);
/* Stop keep-alive timer if any. */
update_keep_alive(acc, PJ_FALSE, NULL);
} else if (PJSIP_IS_STATUS_IN_CLASS(param->code, 200)) {