origin: Add API to query supported protocols

This will allow selecting a suitable origin when placing outgoing calls.
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-04-12 18:20:56 +02:00
parent 7ad0f4cdd6
commit 0c966fdf83
6 changed files with 82 additions and 0 deletions

View File

@@ -162,3 +162,25 @@ calls_origin_dial(CallsOrigin *self,
return iface->dial(self, number);
}
/**
* calls_origin_supports_protocol:
* @self: A #CallsOrigin
* @protocol: The protocol to check support for
*
* Returns: %TRUE if the origin supports the protocol, %FALSE otherwise
*/
gboolean
calls_origin_supports_protocol (CallsOrigin *self,
const char *protocol)
{
CallsOriginInterface *iface;
g_return_val_if_fail (CALLS_IS_ORIGIN (self), FALSE);
g_return_val_if_fail (protocol != NULL, FALSE);
iface = CALLS_ORIGIN_GET_IFACE (self);
g_return_val_if_fail (iface->supports_protocol != NULL, FALSE);
return iface->supports_protocol (self, protocol);
}