From 7d8f0afd7436b26eb58bc060adb27a3b2f051184 Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Mon, 11 Nov 2024 11:25:24 +0100 Subject: [PATCH] menu: fix 302 Moved Temporarily redirect call The UA_EVENT_CALL_REDIRECT event contains the status code and Contact URI with comma separated. E.g.: 302,sip:10.10.0.5 --- modules/menu/menu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/menu/menu.c b/modules/menu/menu.c index 06a6f2d33..38c5703f3 100644 --- a/modules/menu/menu.c +++ b/modules/menu/menu.c @@ -905,10 +905,14 @@ static void event_handler(enum ua_event ev, struct bevent *event, void *arg) break; case UA_EVENT_CALL_REDIRECT: - uri = strchr(prm, ',') + 1; + uri = strchr(prm, ','); + if (!uri) + break; + + ++uri; if (account_sip_autoredirect(ua_account(ua))) { info("menu: redirecting call to %s\n", uri); - menu_invite(prm); + menu_invite(uri); } else { info("menu: redirect call to %s\n", uri);