From f5cd48bd99d2236cf4a9c463caa241865559e1be Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Sat, 17 Jul 2021 14:55:18 +0200 Subject: [PATCH] sip: origin: Add protocol prefix if missing --- plugins/sip/calls-sip-origin.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/sip/calls-sip-origin.c b/plugins/sip/calls-sip-origin.c index 1fc7830..ceac592 100644 --- a/plugins/sip/calls-sip-origin.c +++ b/plugins/sip/calls-sip-origin.c @@ -287,7 +287,16 @@ dial (CallsOrigin *origin, g_debug ("Calling `%s' from origin '%s'", address, name); - add_call (CALLS_SIP_ORIGIN (origin), address, FALSE, nh); + /* We don't require the user to input the prefix */ + if (!g_str_has_prefix (address, "sip:") && + !g_str_has_prefix (address, "sips:")) { + g_autofree char * address_prefix = + g_strconcat (self->protocol_prefix, ":", address, NULL); + + add_call (CALLS_SIP_ORIGIN (origin), address_prefix, FALSE, nh); + } else { + add_call (CALLS_SIP_ORIGIN (origin), address, FALSE, nh); + } } static void