sip-origin: Honour set port when completing address

This makes sure to include the port when dialing the short form.

Fixes: #506
This commit is contained in:
Evangelos Ribeiro Tzaras
2022-10-06 12:07:46 +02:00
parent 563ceb770c
commit 9d63f8961c

View File

@@ -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);