From 9d63f8961ca64ed692863a050d9721ae59a498e3 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Thu, 6 Oct 2022 12:07:46 +0200 Subject: [PATCH] sip-origin: Honour set port when completing address This makes sure to include the port when dialing the short form. Fixes: #506 --- plugins/provider/sip/calls-sip-origin.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/provider/sip/calls-sip-origin.c b/plugins/provider/sip/calls-sip-origin.c index 1ed9f5b..ad56127 100644 --- a/plugins/provider/sip/calls-sip-origin.c +++ b/plugins/provider/sip/calls-sip-origin.c @@ -361,10 +361,14 @@ dial (CallsOrigin *origin, TAG_END ()); /* Make sure @host is in the dial target */ - if (g_strstr_len (address, -1, "@")) + if (g_strstr_len (address, -1, "@")) { dial_target = g_strdup (address); - else - dial_target = g_strconcat (address, "@", self->host, NULL); + } else { + if (self->port > 0) + dial_target = g_strconcat (address, "@", self->host, ":", self->port, NULL); + else + dial_target = g_strconcat (address, "@", self->host, NULL); + } g_debug ("Calling `%s' from origin '%s'", address, name);