diff options
40 files changed, 655 insertions, 655 deletions
@@ -16,20 +16,20 @@ And then continue with the normal: sh> ./configure sh> make -Running +Running ------- -Set the "TPSIP_PERSIST" environment variable to prevent the connection +Set the "RAKIA_PERSIST" environment variable to prevent the connection manager from exiting after all connections have been disconnected. This option is only available if telepathy-sofiasip was configured with the "--enable-debug" option, which is on by default. Other useful environment variables: -* TPSIP_DEBUG -- enables debug tracing via g_log. +* RAKIA_DEBUG -- enables debug tracing via g_log. The value "all" enables all categories; for detailed categories look into - the file 'src/debug.c'. + the file 'src/debug.c' * TPORT_LOG -- setting to 1 enables logging of SIP protocol messages. See also Sofia-SIP documentation for environment variables to enable tracing -in various modules of the Sofia-SIP library: +in various modules of the Sofia-SIP library: http://sofia-sip.sourceforge.net/refdocs/pages.html diff --git a/docs/telepathy-rakia.8.in b/docs/telepathy-rakia.8.in index b57c519..7e2d353 100644 --- a/docs/telepathy-rakia.8.in +++ b/docs/telepathy-rakia.8.in @@ -20,16 +20,16 @@ start it manually for debugging. There are no command-line options. .SH ENVIRONMENT .TP -\fBTPSIP_DEBUG\fR=\fItype\fR +\fBRAKIA_DEBUG\fR=\fItype\fR May be set to "all" for full debug output, or various undocumented options (which may change from release to release) to filter the output. .TP -\fBTPSIP_LOGFILE\fR=\fIfilename\fR +\fBRAKIA_LOGFILE\fR=\fIfilename\fR May be set to the name of a file to overwrite with log messages. The filename may be prefixed with \fB+\fR to append messages to an existing file instead of overwriting it. .TP -\fBTPSIP_PERSIST\fR +\fBRAKIA_PERSIST\fR May be set to any value to avoid telepathy-rakia's usual automatic exit when there have been no connections for a few seconds. .TP diff --git a/extensions/Makefile.am b/extensions/Makefile.am index b0ea184..ae4abf8 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -60,7 +60,7 @@ extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl _gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \ $(top_srcdir)/tools/glib-gtypes-generator.py $(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ - $< _gen/gtypes TPSIP + $< _gen/gtypes RAKIA _gen/signals-marshal.list: _gen/all.xml \ $(tools_dir)/glib-signals-marshal-gen.py diff --git a/rakia/base-connection-sofia.c b/rakia/base-connection-sofia.c index de68ea5..437fa82 100644 --- a/rakia/base-connection-sofia.c +++ b/rakia/base-connection-sofia.c @@ -25,7 +25,7 @@ #include <rakia/base-connection.h> #include <sofia-sip/su_tag_io.h> -#define DEBUG_FLAG TPSIP_DEBUG_EVENTS +#define DEBUG_FLAG RAKIA_DEBUG_EVENTS #include "rakia/debug.h" static void diff --git a/rakia/base-connection.c b/rakia/base-connection.c index 597b5f5..d8fda06 100644 --- a/rakia/base-connection.c +++ b/rakia/base-connection.c @@ -55,7 +55,7 @@ G_DEFINE_TYPE_WITH_CODE (RakiaBaseConnection, rakia_base_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init); - G_IMPLEMENT_INTERFACE (TPSIP_TYPE_EVENT_TARGET, event_target_iface_init); + G_IMPLEMENT_INTERFACE (RAKIA_TYPE_EVENT_TARGET, event_target_iface_init); ); static void @@ -64,7 +64,7 @@ rakia_base_connection_init (RakiaBaseConnection *self) GObject *object = G_OBJECT (self); TpBaseConnection *base = TP_BASE_CONNECTION (self); - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TPSIP_TYPE_BASE_CONNECTION, + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, RAKIA_TYPE_BASE_CONNECTION, RakiaBaseConnectionPrivate); tp_contacts_mixin_init (object, @@ -84,7 +84,7 @@ rakia_base_connection_constructed(GObject *object) static void rakia_base_connection_dispose(GObject *object) { - RakiaBaseConnection *self = TPSIP_BASE_CONNECTION(object); + RakiaBaseConnection *self = RAKIA_BASE_CONNECTION(object); if (self->priv->dispose_has_run) return; @@ -105,7 +105,7 @@ rakia_base_connection_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaBaseConnection *self = TPSIP_BASE_CONNECTION (object); + RakiaBaseConnection *self = RAKIA_BASE_CONNECTION (object); RakiaBaseConnectionPrivate *priv = self->priv; switch (property_id) @@ -126,7 +126,7 @@ rakia_base_connection_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaBaseConnection *self = TPSIP_BASE_CONNECTION (object); + RakiaBaseConnection *self = RAKIA_BASE_CONNECTION (object); RakiaBaseConnectionPrivate *priv = self->priv; switch (property_id) @@ -178,7 +178,7 @@ nua_handle_t * rakia_base_connection_create_handle (RakiaBaseConnection *self, TpHandle tphandle) { - RakiaBaseConnectionClass *cls = TPSIP_BASE_CONNECTION_GET_CLASS (self); + RakiaBaseConnectionClass *cls = RAKIA_BASE_CONNECTION_GET_CLASS (self); return cls->create_handle (self, tphandle); } @@ -187,7 +187,7 @@ void rakia_base_connection_add_auth_handler (RakiaBaseConnection *self, RakiaEventTarget *target) { - RakiaBaseConnectionClass *cls = TPSIP_BASE_CONNECTION_GET_CLASS (self); + RakiaBaseConnectionClass *cls = RAKIA_BASE_CONNECTION_GET_CLASS (self); if (cls->add_auth_handler) cls->add_auth_handler (self, target); diff --git a/rakia/base-connection.h b/rakia/base-connection.h index dafb70f..0a2a047 100644 --- a/rakia/base-connection.h +++ b/rakia/base-connection.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_BASE_CONNECTION_H__ -#define __TPSIP_BASE_CONNECTION_H__ +#ifndef __RAKIA_BASE_CONNECTION_H__ +#define __RAKIA_BASE_CONNECTION_H__ #include <glib-object.h> @@ -52,21 +52,21 @@ struct _RakiaBaseConnection { GType rakia_base_connection_get_type (void) G_GNUC_CONST; /* TYPE MACROS */ -#define TPSIP_TYPE_BASE_CONNECTION \ +#define RAKIA_TYPE_BASE_CONNECTION \ (rakia_base_connection_get_type()) -#define TPSIP_BASE_CONNECTION(obj) \ +#define RAKIA_BASE_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - TPSIP_TYPE_BASE_CONNECTION, RakiaBaseConnection)) -#define TPSIP_BASE_CONNECTION_CLASS(klass) \ + RAKIA_TYPE_BASE_CONNECTION, RakiaBaseConnection)) +#define RAKIA_BASE_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ - TPSIP_TYPE_BASE_CONNECTION, RakiaBaseConnectionClass)) -#define TPSIP_IS_BASE_CONNECTION(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_BASE_CONNECTION)) -#define TPSIP_IS_BASE_CONNECTION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_BASE_CONNECTION)) -#define TPSIP_BASE_CONNECTION_GET_CLASS(obj) \ + RAKIA_TYPE_BASE_CONNECTION, RakiaBaseConnectionClass)) +#define RAKIA_IS_BASE_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_BASE_CONNECTION)) +#define RAKIA_IS_BASE_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_BASE_CONNECTION)) +#define RAKIA_BASE_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TPSIP_TYPE_BASE_CONNECTION, RakiaBaseConnectionClass)) + RAKIA_TYPE_BASE_CONNECTION, RakiaBaseConnectionClass)) /*********************************************************************** * Functions for accessing Sofia-SIP interface handles @@ -89,4 +89,4 @@ void rakia_base_connection_sofia_callback (nua_event_t event, G_END_DECLS -#endif /* #ifndef __TPSIP_BASE_CONNECTION_H__*/ +#endif /* #ifndef __RAKIA_BASE_CONNECTION_H__*/ diff --git a/rakia/codec-param-formats.h b/rakia/codec-param-formats.h index f5a717f..feb0f86 100644 --- a/rakia/codec-param-formats.h +++ b/rakia/codec-param-formats.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CODEC_PARAM_FORMATS_H__ -#define __TPSIP_CODEC_PARAM_FORMATS_H__ +#ifndef __RAKIA_CODEC_PARAM_FORMATS_H__ +#define __RAKIA_CODEC_PARAM_FORMATS_H__ #include <glib.h> @@ -77,4 +77,4 @@ void rakia_codec_param_parse_generic (const gchar *str, GHashTable *out); G_END_DECLS -#endif /* !__TPSIP_CODEC_PARAM_FORMATS_H__ */ +#endif /* !__RAKIA_CODEC_PARAM_FORMATS_H__ */ diff --git a/rakia/connection-aliasing.c b/rakia/connection-aliasing.c index 403f55e..4162cf7 100644 --- a/rakia/connection-aliasing.c +++ b/rakia/connection-aliasing.c @@ -35,7 +35,7 @@ #include <string.h> -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" enum { @@ -82,7 +82,7 @@ rakia_connection_aliasing_get_type (void) type = g_type_register_static (G_TYPE_INTERFACE, "RakiaConnectionAliasingInterface", &info, 0); - g_type_interface_add_prerequisite (type, TPSIP_TYPE_BASE_CONNECTION); + g_type_interface_add_prerequisite (type, RAKIA_TYPE_BASE_CONNECTION); g_type_interface_add_prerequisite (type, TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING); } diff --git a/rakia/connection-aliasing.h b/rakia/connection-aliasing.h index bc30565..b2482e4 100644 --- a/rakia/connection-aliasing.h +++ b/rakia/connection-aliasing.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_ALIASING_H__ -#define __TPSIP_CONNECTION_ALIASING_H__ +#ifndef __RAKIA_CONNECTION_ALIASING_H__ +#define __RAKIA_CONNECTION_ALIASING_H__ #include <glib-object.h> @@ -31,16 +31,16 @@ typedef struct _RakiaConnectionAliasingInterface RakiaConnectionAliasingInterface; /* TYPE MACROS */ -#define TPSIP_TYPE_CONNECTION_ALIASING \ +#define RAKIA_TYPE_CONNECTION_ALIASING \ (rakia_connection_aliasing_get_type ()) -#define TPSIP_CONNECTION_ALIASING(obj) \ +#define RAKIA_CONNECTION_ALIASING(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - TPSIP_TYPE_CONNECTION_ALIASING, RakiaConnectionAliasing)) -#define TPSIP_IS_CONNECTION_ALIASING(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_CONNECTION_ALIASING)) -#define TPSIP_CONNECTION_ALIASING_GET_INTERFACE(obj) \ + RAKIA_TYPE_CONNECTION_ALIASING, RakiaConnectionAliasing)) +#define RAKIA_IS_CONNECTION_ALIASING(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_CONNECTION_ALIASING)) +#define RAKIA_CONNECTION_ALIASING_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE((obj), \ - TPSIP_TYPE_CONNECTION_ALIASING, RakiaConnectionAliasingInterface)) + RAKIA_TYPE_CONNECTION_ALIASING, RakiaConnectionAliasingInterface)) struct _RakiaConnectionAliasingInterface { GTypeInterface base_iface; @@ -55,4 +55,4 @@ void rakia_connection_aliasing_svc_iface_init (gpointer g_iface, G_END_DECLS -#endif /*__TPSIP_CONN_ALIASING_H__*/ +#endif /*__RAKIA_CONN_ALIASING_H__*/ diff --git a/rakia/debug.c b/rakia/debug.c index 11f7b6a..05ca9e8 100644 --- a/rakia/debug.c +++ b/rakia/debug.c @@ -33,18 +33,18 @@ static RakiaDebugFlags rakia_debug_flags = 0; static const GDebugKey rakia_debug_keys[] = { - { "media-channel", TPSIP_DEBUG_MEDIA }, - { "connection", TPSIP_DEBUG_CONNECTION }, - { "im", TPSIP_DEBUG_IM }, - { "events", TPSIP_DEBUG_EVENTS }, - { "sofia", TPSIP_DEBUG_SOFIA }, + { "media-channel", RAKIA_DEBUG_MEDIA }, + { "connection", RAKIA_DEBUG_CONNECTION }, + { "im", RAKIA_DEBUG_IM }, + { "events", RAKIA_DEBUG_EVENTS }, + { "sofia", RAKIA_DEBUG_SOFIA }, }; void rakia_debug_set_flags_from_env () { const gchar *flags_string; - flags_string = g_getenv ("TPSIP_DEBUG"); + flags_string = g_getenv ("RAKIA_DEBUG"); if (flags_string == NULL) flags_string = g_getenv ("RAKIA_DEBUG"); @@ -156,7 +156,7 @@ rakia_sofia_log_handler (void *logdata, const char *format, va_list args) if (buf->str[buf->len - 1] == '\n') { g_string_truncate (buf, buf->len - 1); - rakia_log (TPSIP_DEBUG_SOFIA, G_LOG_LEVEL_DEBUG, "%s", buf->str); + rakia_log (RAKIA_DEBUG_SOFIA, G_LOG_LEVEL_DEBUG, "%s", buf->str); g_string_truncate (buf, 0); } #endif diff --git a/rakia/debug.h b/rakia/debug.h index 58d7628..638363a 100644 --- a/rakia/debug.h +++ b/rakia/debug.h @@ -26,11 +26,11 @@ G_BEGIN_DECLS typedef enum { - TPSIP_DEBUG_CONNECTION = 1 << 0, - TPSIP_DEBUG_MEDIA = 1 << 1, - TPSIP_DEBUG_IM = 1 << 2, - TPSIP_DEBUG_EVENTS = 1 << 3, - TPSIP_DEBUG_SOFIA = 1 << 4, + RAKIA_DEBUG_CONNECTION = 1 << 0, + RAKIA_DEBUG_MEDIA = 1 << 1, + RAKIA_DEBUG_IM = 1 << 2, + RAKIA_DEBUG_EVENTS = 1 << 3, + RAKIA_DEBUG_SOFIA = 1 << 4, } RakiaDebugFlags; void rakia_debug_set_flags_from_env (); diff --git a/rakia/event-target.c b/rakia/event-target.c index 74bec43..777413b 100644 --- a/rakia/event-target.c +++ b/rakia/event-target.c @@ -22,10 +22,10 @@ #include "signals-marshal.h" /* Define to the highest known nua_event_e enumeration member */ -#define TPSIP_NUA_EVENT_LAST nua_i_register +#define RAKIA_NUA_EVENT_LAST nua_i_register /* Mapping of the event enumeration to signal detail quarks */ -static GQuark event_quarks[TPSIP_NUA_EVENT_LAST + 1] = {0}; +static GQuark event_quarks[RAKIA_NUA_EVENT_LAST + 1] = {0}; /* Signals */ enum { @@ -70,7 +70,7 @@ rakia_event_target_base_init (gpointer klass) G_TYPE_POINTER, G_TYPE_POINTER); - for (i = 0; i <= TPSIP_NUA_EVENT_LAST; i++) + for (i = 0; i <= RAKIA_NUA_EVENT_LAST; i++) event_quarks[i] = g_quark_from_static_string (nua_event_name ((nua_event_t) i)); } @@ -136,7 +136,7 @@ rakia_event_target_attach (nua_handle_t *nh, GObject *obj) { g_assert (nh != NULL); - nua_handle_bind (nh, TPSIP_EVENT_TARGET (obj)); + nua_handle_bind (nh, RAKIA_EVENT_TARGET (obj)); nua_handle_ref (nh); g_object_weak_ref (obj, _rakia_event_target_finalized, nh); @@ -184,11 +184,11 @@ rakia_event_target_emit_nua_event (gpointer instance, gint nua_event; GQuark detail; - g_assert (TPSIP_IS_EVENT_TARGET (instance)); + g_assert (RAKIA_IS_EVENT_TARGET (instance)); nua_event = ev->nua_event; - detail = G_LIKELY (nua_event >= 0 && nua_event <= TPSIP_NUA_EVENT_LAST) + detail = G_LIKELY (nua_event >= 0 && nua_event <= RAKIA_NUA_EVENT_LAST) ? event_quarks[nua_event] : g_quark_from_static_string (nua_event_name (nua_event)); @@ -239,7 +239,7 @@ rakia_event_target_gone_iface_init (gpointer g_iface, gpointer iface_data) G_DEFINE_TYPE_WITH_CODE (RakiaEventTargetGone, rakia_event_target_gone, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (TPSIP_TYPE_EVENT_TARGET, rakia_event_target_gone_iface_init)) + G_IMPLEMENT_INTERFACE (RAKIA_TYPE_EVENT_TARGET, rakia_event_target_gone_iface_init)) static void rakia_event_target_gone_class_init (RakiaEventTargetGoneClass *klass) @@ -267,5 +267,5 @@ rakia_event_target_gone_instance () g_once (&init_gone_once, _rakia_event_target_gone_new_instance, NULL); - return TPSIP_EVENT_TARGET (init_gone_once.retval); + return RAKIA_EVENT_TARGET (init_gone_once.retval); } diff --git a/rakia/event-target.h b/rakia/event-target.h index c6aae9c..f078708 100644 --- a/rakia/event-target.h +++ b/rakia/event-target.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_EVENT_TARGET_H__ -#define __TPSIP_EVENT_TARGET_H__ +#ifndef __RAKIA_EVENT_TARGET_H__ +#define __RAKIA_EVENT_TARGET_H__ #include <glib-object.h> #include <rakia/sofia-decls.h> @@ -59,14 +59,14 @@ typedef struct _RakiaEventTarget RakiaEventTarget; typedef struct _RakiaEventTargetInterface RakiaEventTargetInterface; /* TYPE MACROS */ -#define TPSIP_TYPE_EVENT_TARGET \ +#define RAKIA_TYPE_EVENT_TARGET \ (rakia_event_target_get_type ()) -#define TPSIP_EVENT_TARGET(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_EVENT_TARGET, RakiaEventTarget)) -#define TPSIP_IS_EVENT_TARGET(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_EVENT_TARGET)) -#define TPSIP_EVENT_TARGET_GET_INTERFACE(obj) \ - (G_TYPE_INSTANCE_GET_INTERFACE((obj), TPSIP_TYPE_EVENT_TARGET, RakiaEventTargetInterface)) +#define RAKIA_EVENT_TARGET(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_EVENT_TARGET, RakiaEventTarget)) +#define RAKIA_IS_EVENT_TARGET(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_EVENT_TARGET)) +#define RAKIA_EVENT_TARGET_GET_INTERFACE(obj) \ + (G_TYPE_INSTANCE_GET_INTERFACE((obj), RAKIA_TYPE_EVENT_TARGET, RakiaEventTargetInterface)) struct _RakiaEventTargetInterface { GTypeInterface base_iface; @@ -89,4 +89,4 @@ gboolean rakia_event_target_emit_nua_event (gpointer instance, G_END_DECLS -#endif /*__TPSIP_EVENT_TARGET_H__*/ +#endif /*__RAKIA_EVENT_TARGET_H__*/ diff --git a/rakia/handles.c b/rakia/handles.c index 5031dd0..7fa7e99 100644 --- a/rakia/handles.c +++ b/rakia/handles.c @@ -25,7 +25,7 @@ #include <rakia/handles.h> #include <sofia-sip/sip_header.h> -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" static GQuark @@ -240,7 +240,7 @@ priv_lowercase_url_part (su_home_t *home, const char *src) return (const char *) res; } -#define TPSIP_RESERVED_CHARS_ALLOWED_IN_USERNAME "!*'()&=+$,;?/" +#define RAKIA_RESERVED_CHARS_ALLOWED_IN_USERNAME "!*'()&=+$,;?/" gchar * rakia_normalize_contact (const gchar *sipuri, @@ -274,7 +274,7 @@ rakia_normalize_contact (const gchar *sipuri, else { user = g_uri_escape_string (sipuri, - TPSIP_RESERVED_CHARS_ALLOWED_IN_USERNAME, FALSE); + RAKIA_RESERVED_CHARS_ALLOWED_IN_USERNAME, FALSE); } if (base_url->url_type == url_sips) diff --git a/rakia/handles.h b/rakia/handles.h index 914f167..c18f3fa 100644 --- a/rakia/handles.h +++ b/rakia/handles.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef TPSIP_HANDLE_H -#define TPSIP_HANDLE_H +#ifndef RAKIA_HANDLE_H +#define RAKIA_HANDLE_H #include <telepathy-glib/base-connection.h> #include <sofia-sip/sip.h> @@ -44,4 +44,4 @@ gchar *rakia_normalize_contact (const gchar *sipuri, G_END_DECLS -#endif /* !TPSIP_HANDLE_H */ +#endif /* !RAKIA_HANDLE_H */ diff --git a/rakia/media-channel.c b/rakia/media-channel.c index 089b2b9..57b1823 100644 --- a/rakia/media-channel.c +++ b/rakia/media-channel.c @@ -39,13 +39,13 @@ #include <rakia/event-target.h> -#define DEBUG_FLAG TPSIP_DEBUG_MEDIA +#define DEBUG_FLAG RAKIA_DEBUG_MEDIA #include "rakia/debug.h" #include <rakia/media-session.h> #include <rakia/base-connection.h> -#define TPSIP_CHANNEL_CALL_STATE_PROCEEDING_MASK \ +#define RAKIA_CHANNEL_CALL_STATE_PROCEEDING_MASK \ (TP_CHANNEL_CALL_STATE_RINGING | \ TP_CHANNEL_CALL_STATE_QUEUED | \ TP_CHANNEL_CALL_STATE_IN_PROGRESS) @@ -60,7 +60,7 @@ static void hold_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (RakiaMediaChannel, rakia_media_channel, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (TPSIP_TYPE_EVENT_TARGET, event_target_init); + G_IMPLEMENT_INTERFACE (RAKIA_TYPE_EVENT_TARGET, event_target_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_PROPERTIES_INTERFACE, @@ -163,7 +163,7 @@ struct _RakiaMediaChannelPrivate gboolean dispose_has_run; }; -#define TPSIP_MEDIA_CHANNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_MEDIA_CHANNEL, RakiaMediaChannelPrivate)) +#define RAKIA_MEDIA_CHANNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_MEDIA_CHANNEL, RakiaMediaChannelPrivate)) /*********************************************************************** * Set: Gobject interface @@ -172,7 +172,7 @@ struct _RakiaMediaChannelPrivate static void rakia_media_channel_init (RakiaMediaChannel *self) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); /* allocate any data required by the object here */ priv->call_states = g_hash_table_new (NULL, NULL); @@ -186,8 +186,8 @@ rakia_media_channel_init (RakiaMediaChannel *self) static void rakia_media_channel_constructed (GObject *obj) { - RakiaMediaChannel *chan = TPSIP_MEDIA_CHANNEL (obj); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (chan); + RakiaMediaChannel *chan = RAKIA_MEDIA_CHANNEL (obj); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (chan); TpBaseConnection *conn = (TpBaseConnection *)(priv->conn); GObjectClass *parent_object_class = G_OBJECT_CLASS (rakia_media_channel_parent_class); @@ -324,7 +324,7 @@ rakia_media_channel_class_init (RakiaMediaChannelClass *klass) param_spec = g_param_spec_object ("connection", "RakiaConnection object", "SIP connection object that owns this SIP media channel object.", - TPSIP_TYPE_BASE_CONNECTION, + RAKIA_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); @@ -430,8 +430,8 @@ rakia_media_channel_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaMediaChannel *chan = TPSIP_MEDIA_CHANNEL (object); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (chan); + RakiaMediaChannel *chan = RAKIA_MEDIA_CHANNEL (object); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (chan); TpBaseConnection *base_conn = TP_BASE_CONNECTION (priv->conn); switch (property_id) { @@ -572,8 +572,8 @@ rakia_media_channel_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaMediaChannel *chan = TPSIP_MEDIA_CHANNEL (object); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (chan); + RakiaMediaChannel *chan = RAKIA_MEDIA_CHANNEL (object); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (chan); switch (property_id) { case PROP_HANDLE_TYPE: @@ -631,8 +631,8 @@ rakia_media_channel_set_property (GObject *object, static void rakia_media_channel_dispose (GObject *object) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (object); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (object); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); TpHandleRepoIface *contact_handles; if (priv->dispose_has_run) @@ -662,8 +662,8 @@ rakia_media_channel_dispose (GObject *object) static void rakia_media_channel_finalize (GObject *object) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (object); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (object); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); g_hash_table_destroy (priv->call_states); @@ -694,7 +694,7 @@ static void rakia_media_channel_dbus_close (TpSvcChannel *iface, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); rakia_media_channel_close (self); tp_svc_channel_return_from_close (context); @@ -707,8 +707,8 @@ rakia_media_channel_close (RakiaMediaChannel *obj) DEBUG("enter"); - g_assert (TPSIP_IS_MEDIA_CHANNEL (obj)); - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (obj); + g_assert (RAKIA_IS_MEDIA_CHANNEL (obj)); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (obj); if (priv->closed) return; @@ -750,8 +750,8 @@ static void rakia_media_channel_get_handle (TpSvcChannel *iface, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); if (priv->handle != 0) tp_svc_channel_return_from_get_handle (context, TP_HANDLE_TYPE_CONTACT, @@ -794,16 +794,16 @@ static void rakia_media_channel_get_session_handlers (TpSvcChannelInterfaceMediaSignalling *iface, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); RakiaMediaChannelPrivate *priv; GPtrArray *ret; GValue handler = { 0 }; DEBUG("enter"); - g_assert (TPSIP_IS_MEDIA_CHANNEL (self)); + g_assert (RAKIA_IS_MEDIA_CHANNEL (self)); - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); ret = g_ptr_array_new (); @@ -859,11 +859,11 @@ static void rakia_media_channel_list_streams (TpSvcChannelTypeStreamedMedia *iface, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); RakiaMediaChannelPrivate *priv; GPtrArray *ret = NULL; - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); ret = g_ptr_array_new (); @@ -886,11 +886,11 @@ rakia_media_channel_remove_streams (TpSvcChannelTypeStreamedMedia *iface, const GArray *streams, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); RakiaMediaChannelPrivate *priv; GError *error = NULL; - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); if (priv->immutable_streams) { @@ -931,11 +931,11 @@ rakia_media_channel_request_stream_direction (TpSvcChannelTypeStreamedMedia *ifa guint stream_direction, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); RakiaMediaChannelPrivate *priv; GError *error = NULL; - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); if (priv->immutable_streams) { @@ -982,7 +982,7 @@ rakia_media_channel_request_streams (TpSvcChannelTypeStreamedMedia *iface, const GArray *types, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); GError *error = NULL; GPtrArray *ret = NULL; RakiaMediaChannelPrivate *priv; @@ -990,7 +990,7 @@ rakia_media_channel_request_streams (TpSvcChannelTypeStreamedMedia *iface, DEBUG("enter"); - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); if (priv->immutable_streams) { @@ -1038,7 +1038,7 @@ rakia_media_channel_request_streams (TpSvcChannelTypeStreamedMedia *iface, void rakia_media_channel_create_initial_streams (RakiaMediaChannel *self) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); g_assert (priv->initiator != priv->handle); @@ -1074,7 +1074,7 @@ rakia_media_channel_handle_incoming_call (RakiaMediaChannel *self, nua_handle_t *nh, const sdp_session_t *sdp) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); TpBaseConnection *conn = TP_BASE_CONNECTION (priv->conn); g_assert (priv->initiator != conn->self_handle); @@ -1122,7 +1122,7 @@ priv_nua_i_invite_cb (RakiaMediaChannel *self, tagi_t tags[], gpointer foo) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); /* nua_i_invite delivered for a bound handle means a re-INVITE */ @@ -1137,7 +1137,7 @@ static guint rakia_media_channel_get_call_state (RakiaMediaChannel *self, TpHandle peer) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); return GPOINTER_TO_UINT (g_hash_table_lookup (priv->call_states, GUINT_TO_POINTER (peer))); @@ -1169,7 +1169,7 @@ rakia_media_channel_peer_error (RakiaMediaChannel *self, case 404: case 480: reason = (rakia_media_channel_get_call_state (self, peer) - & TPSIP_CHANNEL_CALL_STATE_PROCEEDING_MASK) + & RAKIA_CHANNEL_CALL_STATE_PROCEEDING_MASK) ? TP_CHANNEL_GROUP_CHANGE_REASON_NO_ANSWER : TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE; break; @@ -1201,7 +1201,7 @@ rakia_media_channel_change_call_state (RakiaMediaChannel *self, guint flags_add, guint flags_remove) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); gpointer key = GUINT_TO_POINTER (peer); guint old_state; guint new_state; @@ -1234,7 +1234,7 @@ priv_nua_i_bye_cb (RakiaMediaChannel *self, tagi_t tags[], gpointer foo) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); TpGroupMixin *mixin = TP_GROUP_MIXIN (self); TpIntSet *remove; TpHandle peer; @@ -1261,7 +1261,7 @@ priv_nua_i_cancel_cb (RakiaMediaChannel *self, tagi_t tags[], gpointer foo) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); TpGroupMixin *mixin = TP_GROUP_MIXIN (self); TpIntSet *remove; TpHandle actor = 0; @@ -1326,7 +1326,7 @@ priv_nua_i_state_cb (RakiaMediaChannel *self, tagi_t tags[], gpointer foo) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); const sdp_session_t *r_sdp = NULL; int offer_recv = 0; int answer_recv = 0; @@ -1393,7 +1393,7 @@ priv_nua_i_state_cb (RakiaMediaChannel *self, /* Clear any pre-establishment call states */ rakia_media_channel_change_call_state (self, peer, 0, - TPSIP_CHANNEL_CALL_STATE_PROCEEDING_MASK); + RAKIA_CHANNEL_CALL_STATE_PROCEEDING_MASK); if (status < 300) { @@ -1426,7 +1426,7 @@ priv_nua_i_state_cb (RakiaMediaChannel *self, /* In cases of self-inflicted termination, * we should have already gone through the moves */ if (rakia_media_session_get_state (priv->session) - == TPSIP_MEDIA_SESSION_STATE_ENDED) + == RAKIA_MEDIA_SESSION_STATE_ENDED) break; if (status >= 300) @@ -1436,7 +1436,7 @@ priv_nua_i_state_cb (RakiaMediaChannel *self, } rakia_media_session_change_state (priv->session, - TPSIP_MEDIA_SESSION_STATE_ENDED); + RAKIA_MEDIA_SESSION_STATE_ENDED); break; default: @@ -1451,7 +1451,7 @@ static void priv_session_state_changed_cb (RakiaMediaSession *session, guint state, RakiaMediaChannel *channel) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (channel); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (channel); TpGroupMixin *mixin = TP_GROUP_MIXIN (channel); TpHandle self_handle; TpHandle peer; @@ -1464,7 +1464,7 @@ static void priv_session_state_changed_cb (RakiaMediaSession *session, switch (state) { - case TPSIP_MEDIA_SESSION_STATE_INVITE_SENT: + case RAKIA_MEDIA_SESSION_STATE_INVITE_SENT: g_assert (priv->initiator == self_handle); /* add the peer to remote pending */ @@ -1484,7 +1484,7 @@ static void priv_session_state_changed_cb (RakiaMediaSession *session, break; - case TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED: /* add ourself to local pending */ set = tp_intset_new_containing (self_handle); tp_group_mixin_change_members ((GObject *) channel, "", @@ -1507,7 +1507,7 @@ static void priv_session_state_changed_cb (RakiaMediaSession *session, break; - case TPSIP_MEDIA_SESSION_STATE_ACTIVE: + case RAKIA_MEDIA_SESSION_STATE_ACTIVE: if (priv->initiator == self_handle) { if (!tp_handle_set_is_member (mixin->remote_pending, peer)) @@ -1546,7 +1546,7 @@ static void priv_session_state_changed_cb (RakiaMediaSession *session, break; - case TPSIP_MEDIA_SESSION_STATE_ENDED: + case RAKIA_MEDIA_SESSION_STATE_ENDED: set = tp_intset_new (); /* remove us and the peer from the member list */ @@ -1574,13 +1574,13 @@ void rakia_media_channel_attach_to_nua_handle (RakiaMediaChannel *self, nua_handle_t *nh) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); rakia_event_target_attach (nh, (GObject *) self); /* have the connection handle authentication, before all other * response callbacks */ - rakia_base_connection_add_auth_handler (priv->conn, TPSIP_EVENT_TARGET (self)); + rakia_base_connection_add_auth_handler (priv->conn, RAKIA_EVENT_TARGET (self)); g_signal_connect (self, "nua-event::nua_i_invite", @@ -1620,7 +1620,7 @@ priv_create_session (RakiaMediaChannel *channel, DEBUG("enter"); - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (channel); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (channel); conn = (TpBaseConnection *)(priv->conn); contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); @@ -1638,7 +1638,7 @@ priv_create_session (RakiaMediaChannel *channel, "local-ip-address", &local_ip_address, NULL); - session = g_object_new (TPSIP_TYPE_MEDIA_SESSION, + session = g_object_new (RAKIA_TYPE_MEDIA_SESSION, "dbus-daemon", tp_base_connection_get_dbus_daemon (conn), "media-channel", channel, @@ -1669,7 +1669,7 @@ priv_create_session (RakiaMediaChannel *channel, static void priv_destroy_session(RakiaMediaChannel *channel) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (channel); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (channel); RakiaMediaSession *session; TpBaseConnection *conn; TpHandleRepoIface *contact_repo; @@ -1699,7 +1699,7 @@ static void priv_outbound_call (RakiaMediaChannel *channel, TpHandle peer) { - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (channel); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (channel); nua_handle_t *nh; if (priv->session == NULL) @@ -1726,8 +1726,8 @@ _rakia_media_channel_add_member (GObject *iface, const gchar *message, GError **error) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); TpGroupMixin *mixin = TP_GROUP_MIXIN (iface); DEBUG("mixin->self_handle=%d, handle=%d", mixin->self_handle, handle); @@ -1811,8 +1811,8 @@ rakia_media_channel_remove_with_reason (GObject *obj, guint reason, GError **error) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (obj); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (obj); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); TpIntSet *set = NULL; TpHandle self_handle; @@ -1867,7 +1867,7 @@ rakia_media_channel_remove_with_reason (GObject *obj, /* This session is effectively ended, prevent the nua_i_state handler * from useless work */ rakia_media_session_change_state (priv->session, - TPSIP_MEDIA_SESSION_STATE_ENDED); + RAKIA_MEDIA_SESSION_STATE_ENDED); } else { @@ -1883,8 +1883,8 @@ static void rakia_media_channel_get_call_states (TpSvcChannelInterfaceCallState *iface, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); tp_svc_channel_interface_call_state_return_from_get_call_states ( context, @@ -1895,8 +1895,8 @@ static void rakia_media_channel_get_hold_state (TpSvcChannelInterfaceHold *iface, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); - RakiaMediaChannelPrivate *priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); + RakiaMediaChannelPrivate *priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); TpLocalHoldState hold_state = TP_LOCAL_HOLD_STATE_UNHELD; TpLocalHoldStateReason hold_reason = TP_LOCAL_HOLD_STATE_REASON_NONE; @@ -1922,10 +1922,10 @@ rakia_media_channel_request_hold (TpSvcChannelInterfaceHold *iface, gboolean hold, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); RakiaMediaChannelPrivate *priv; - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); if (priv->immutable_streams) { @@ -1955,13 +1955,13 @@ rakia_media_channel_start_tone (TpSvcChannelInterfaceDTMF *iface, guchar event, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); RakiaMediaChannelPrivate *priv; GError *error = NULL; DEBUG("enter"); - g_assert (TPSIP_IS_MEDIA_CHANNEL (self)); + g_assert (RAKIA_IS_MEDIA_CHANNEL (self)); if (event >= NUM_TP_DTMF_EVENTS) { @@ -1972,7 +1972,7 @@ rakia_media_channel_start_tone (TpSvcChannelInterfaceDTMF *iface, return; } - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); if (!rakia_media_session_start_telephony_event (priv->session, stream_id, @@ -1992,15 +1992,15 @@ rakia_media_channel_stop_tone (TpSvcChannelInterfaceDTMF *iface, guint stream_id, DBusGMethodInvocation *context) { - RakiaMediaChannel *self = TPSIP_MEDIA_CHANNEL (iface); + RakiaMediaChannel *self = RAKIA_MEDIA_CHANNEL (iface); RakiaMediaChannelPrivate *priv; GError *error = NULL; DEBUG("enter"); - g_assert (TPSIP_IS_MEDIA_CHANNEL (self)); + g_assert (RAKIA_IS_MEDIA_CHANNEL (self)); - priv = TPSIP_MEDIA_CHANNEL_GET_PRIVATE (self); + priv = RAKIA_MEDIA_CHANNEL_GET_PRIVATE (self); if (!rakia_media_session_stop_telephony_event (priv->session, stream_id, diff --git a/rakia/media-channel.h b/rakia/media-channel.h index 6b8b07d..6407832 100644 --- a/rakia/media-channel.h +++ b/rakia/media-channel.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_MEDIA_CHANNEL_H__ -#define __TPSIP_MEDIA_CHANNEL_H__ +#ifndef __RAKIA_MEDIA_CHANNEL_H__ +#define __RAKIA_MEDIA_CHANNEL_H__ #include <glib-object.h> #include <sofia-sip/sdp.h> @@ -52,18 +52,18 @@ struct _RakiaMediaChannel { GType rakia_media_channel_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_MEDIA_CHANNEL \ +#define RAKIA_TYPE_MEDIA_CHANNEL \ (rakia_media_channel_get_type()) -#define TPSIP_MEDIA_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_MEDIA_CHANNEL, RakiaMediaChannel)) -#define TPSIP_MEDIA_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_MEDIA_CHANNEL, RakiaMediaChannelClass)) -#define TPSIP_IS_MEDIA_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_MEDIA_CHANNEL)) -#define TPSIP_IS_MEDIA_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_MEDIA_CHANNEL)) -#define TPSIP_MEDIA_CHANNEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_MEDIA_CHANNEL, RakiaMediaChannelClass)) +#define RAKIA_MEDIA_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_MEDIA_CHANNEL, RakiaMediaChannel)) +#define RAKIA_MEDIA_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_MEDIA_CHANNEL, RakiaMediaChannelClass)) +#define RAKIA_IS_MEDIA_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_MEDIA_CHANNEL)) +#define RAKIA_IS_MEDIA_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_MEDIA_CHANNEL)) +#define RAKIA_MEDIA_CHANNEL_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_MEDIA_CHANNEL, RakiaMediaChannelClass)) /*********************************************************************** * Additional declarations (not based on generated templates) @@ -89,4 +89,4 @@ rakia_media_channel_change_call_state (RakiaMediaChannel *self, G_END_DECLS -#endif /* #ifndef __TPSIP_MEDIA_CHANNEL_H__*/ +#endif /* #ifndef __RAKIA_MEDIA_CHANNEL_H__*/ diff --git a/rakia/media-manager.c b/rakia/media-manager.c index 57dd807..230ba3a 100644 --- a/rakia/media-manager.c +++ b/rakia/media-manager.c @@ -34,12 +34,12 @@ #include <sofia-sip/sip_status.h> -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" typedef enum { - TPSIP_MEDIA_CHANNEL_CREATE_WITH_AUDIO = 1 << 0, - TPSIP_MEDIA_CHANNEL_CREATE_WITH_VIDEO = 1 << 1, + RAKIA_MEDIA_CHANNEL_CREATE_WITH_AUDIO = 1 << 0, + RAKIA_MEDIA_CHANNEL_CREATE_WITH_VIDEO = 1 << 1, } RakiaMediaChannelCreationFlags; static void channel_manager_iface_init (gpointer, gpointer); @@ -78,12 +78,12 @@ struct _RakiaMediaManagerPrivate gboolean dispose_has_run; }; -#define TPSIP_MEDIA_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_MEDIA_MANAGER, RakiaMediaManagerPrivate)) +#define RAKIA_MEDIA_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_MEDIA_MANAGER, RakiaMediaManagerPrivate)) static void rakia_media_manager_init (RakiaMediaManager *fac) { - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); priv->conn = NULL; priv->channels = g_ptr_array_sized_new (1); @@ -94,8 +94,8 @@ rakia_media_manager_init (RakiaMediaManager *fac) static void rakia_media_manager_dispose (GObject *object) { - RakiaMediaManager *fac = TPSIP_MEDIA_MANAGER (object); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManager *fac = RAKIA_MEDIA_MANAGER (object); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); if (priv->dispose_has_run) return; @@ -112,8 +112,8 @@ rakia_media_manager_dispose (GObject *object) static void rakia_media_manager_finalize (GObject *object) { - RakiaMediaManager *fac = TPSIP_MEDIA_MANAGER (object); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManager *fac = RAKIA_MEDIA_MANAGER (object); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); g_free (priv->stun_server); } @@ -124,8 +124,8 @@ rakia_media_manager_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaMediaManager *fac = TPSIP_MEDIA_MANAGER (object); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManager *fac = RAKIA_MEDIA_MANAGER (object); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); switch (property_id) { case PROP_CONNECTION: @@ -149,8 +149,8 @@ rakia_media_manager_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaMediaManager *fac = TPSIP_MEDIA_MANAGER (object); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManager *fac = RAKIA_MEDIA_MANAGER (object); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); switch (property_id) { case PROP_CONNECTION: @@ -186,7 +186,7 @@ rakia_media_manager_class_init (RakiaMediaManagerClass *klass) param_spec = g_param_spec_object ("connection", "RakiaBaseConnection object", "SIP connection that owns this media channel manager", - TPSIP_TYPE_BASE_CONNECTION, + RAKIA_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); @@ -199,7 +199,7 @@ rakia_media_manager_class_init (RakiaMediaManagerClass *klass) param_spec = g_param_spec_uint ("stun-port", "STUN port", "STUN port.", 0, G_MAXUINT16, - TPSIP_DEFAULT_STUN_PORT, + RAKIA_DEFAULT_STUN_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STUN_PORT, param_spec); } @@ -207,7 +207,7 @@ rakia_media_manager_class_init (RakiaMediaManagerClass *klass) static void rakia_media_manager_close_all (RakiaMediaManager *fac) { - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); if (priv->status_changed_id != 0) { @@ -242,8 +242,8 @@ rakia_media_manager_close_all (RakiaMediaManager *fac) static void media_channel_closed_cb (RakiaMediaChannel *chan, gpointer user_data) { - RakiaMediaManager *fac = TPSIP_MEDIA_MANAGER (user_data); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManager *fac = RAKIA_MEDIA_MANAGER (user_data); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); tp_channel_manager_emit_channel_closed_for_object (fac, TP_EXPORTABLE_CHANNEL (chan)); @@ -276,15 +276,15 @@ new_media_channel (RakiaMediaManager *fac, g_assert (initiator != 0); - priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); object_path = g_strdup_printf ("%s/MediaChannel%u", priv->conn->object_path, priv->channel_index++); DEBUG("channel object path %s", object_path); - initial_audio = ((flags & TPSIP_MEDIA_CHANNEL_CREATE_WITH_AUDIO) != 0); - initial_video = ((flags & TPSIP_MEDIA_CHANNEL_CREATE_WITH_VIDEO) != 0); + initial_audio = ((flags & RAKIA_MEDIA_CHANNEL_CREATE_WITH_AUDIO) != 0); + initial_video = ((flags & RAKIA_MEDIA_CHANNEL_CREATE_WITH_VIDEO) != 0); g_object_get (priv->conn, "immutable-streams", &immutable_streams, @@ -295,7 +295,7 @@ new_media_channel (RakiaMediaManager *fac, nat_traversal = "stun"; } - chan = g_object_new (TPSIP_TYPE_MEDIA_CHANNEL, + chan = g_object_new (RAKIA_TYPE_MEDIA_CHANNEL, "connection", priv->conn, "object-path", object_path, "handle", maybe_peer, @@ -382,7 +382,7 @@ connection_status_changed_cb (RakiaBaseConnection *conn, guint reason, RakiaMediaManager *self) { - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (self); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (self); switch (status) { @@ -412,8 +412,8 @@ connection_status_changed_cb (RakiaBaseConnection *conn, static void rakia_media_manager_constructed (GObject *object) { - RakiaMediaManager *self = TPSIP_MEDIA_MANAGER (object); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (self); + RakiaMediaManager *self = RAKIA_MEDIA_MANAGER (object); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (self); GObjectClass *parent_object_class = G_OBJECT_CLASS (rakia_media_manager_parent_class); @@ -429,8 +429,8 @@ rakia_media_manager_foreach_channel (TpChannelManager *manager, TpExportableChannelFunc foreach, gpointer user_data) { - RakiaMediaManager *fac = TPSIP_MEDIA_MANAGER (manager); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (fac); + RakiaMediaManager *fac = RAKIA_MEDIA_MANAGER (manager); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (fac); guint i; for (i = 0; i < priv->channels->len; i++) @@ -499,8 +499,8 @@ rakia_media_manager_requestotron (TpChannelManager *manager, GHashTable *request_properties, RequestMethod method) { - RakiaMediaManager *self = TPSIP_MEDIA_MANAGER (manager); - RakiaMediaManagerPrivate *priv = TPSIP_MEDIA_MANAGER_GET_PRIVATE (self); + RakiaMediaManager *self = RAKIA_MEDIA_MANAGER (manager); + RakiaMediaManagerPrivate *priv = RAKIA_MEDIA_MANAGER_GET_PRIVATE (self); TpBaseConnection *conn = (TpBaseConnection *) priv->conn; TpHandleType handle_type; TpHandle handle; @@ -615,11 +615,11 @@ rakia_media_manager_requestotron (TpChannelManager *manager, if (tp_asv_get_boolean (request_properties, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio", NULL)) - chan_flags |= TPSIP_MEDIA_CHANNEL_CREATE_WITH_AUDIO; + chan_flags |= RAKIA_MEDIA_CHANNEL_CREATE_WITH_AUDIO; if (tp_asv_get_boolean (request_properties, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo", NULL)) - chan_flags |= TPSIP_MEDIA_CHANNEL_CREATE_WITH_VIDEO; + chan_flags |= RAKIA_MEDIA_CHANNEL_CREATE_WITH_VIDEO; channel = new_media_channel (self, conn->self_handle, handle, chan_flags); diff --git a/rakia/media-manager.h b/rakia/media-manager.h index 7b962be..ab8338c 100644 --- a/rakia/media-manager.h +++ b/rakia/media-manager.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_MEDIA_MANAGER_H__ -#define __TPSIP_MEDIA_MANAGER_H__ +#ifndef __RAKIA_MEDIA_MANAGER_H__ +#define __RAKIA_MEDIA_MANAGER_H__ #include <glib-object.h> @@ -39,18 +39,18 @@ struct _RakiaMediaManager { GType rakia_media_manager_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_MEDIA_MANAGER \ +#define RAKIA_TYPE_MEDIA_MANAGER \ (rakia_media_manager_get_type()) -#define TPSIP_MEDIA_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_MEDIA_MANAGER, RakiaMediaManager)) -#define TPSIP_MEDIA_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_MEDIA_MANAGER, RakiaMediaManagerClass)) -#define TPSIP_IS_MEDIA_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_MEDIA_MANAGER)) -#define TPSIP_IS_MEDIA_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_MEDIA_MANAGER)) -#define TPSIP_MEDIA_MANAGER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_MEDIA_MANAGER, RakiaMediaManagerClass)) +#define RAKIA_MEDIA_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_MEDIA_MANAGER, RakiaMediaManager)) +#define RAKIA_MEDIA_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_MEDIA_MANAGER, RakiaMediaManagerClass)) +#define RAKIA_IS_MEDIA_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_MEDIA_MANAGER)) +#define RAKIA_IS_MEDIA_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_MEDIA_MANAGER)) +#define RAKIA_MEDIA_MANAGER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_MEDIA_MANAGER, RakiaMediaManagerClass)) G_END_DECLS diff --git a/rakia/media-session.c b/rakia/media-session.c index 2766321..45fc9a0 100644 --- a/rakia/media-session.c +++ b/rakia/media-session.c @@ -49,13 +49,13 @@ #include "signals-marshal.h" -#define DEBUG_FLAG TPSIP_DEBUG_MEDIA +#define DEBUG_FLAG RAKIA_DEBUG_MEDIA #include "rakia/debug.h" /* The timeout for outstanding re-INVITE transactions in seconds. * Chosen to match the allowed cancellation timeout for proxies * described in RFC 3261 Section 13.3.1.1 */ -#define TPSIP_REINVITE_TIMEOUT 180 +#define RAKIA_REINVITE_TIMEOUT 180 static void session_handler_iface_init (gpointer, gpointer); @@ -156,7 +156,7 @@ struct _RakiaMediaSessionPrivate gboolean dispose_has_run; }; -#define TPSIP_MEDIA_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_MEDIA_SESSION, RakiaMediaSessionPrivate)) +#define RAKIA_MEDIA_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_MEDIA_SESSION, RakiaMediaSessionPrivate)) static void rakia_media_session_get_property (GObject *object, guint property_id, @@ -182,9 +182,9 @@ static void priv_zap_event (RakiaMediaSession *self); static void rakia_media_session_init (RakiaMediaSession *obj) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (obj); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (obj); - priv->state = TPSIP_MEDIA_SESSION_STATE_CREATED; + priv->state = RAKIA_MEDIA_SESSION_STATE_CREATED; priv->hold_state = TP_LOCAL_HOLD_STATE_UNHELD; priv->hold_reason = TP_LOCAL_HOLD_STATE_REASON_NONE; priv->rtcp_enabled = TRUE; @@ -202,7 +202,7 @@ rakia_media_session_constructor (GType type, guint n_props, obj = G_OBJECT_CLASS (rakia_media_session_parent_class)-> constructor (type, n_props, props); - priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (TPSIP_MEDIA_SESSION (obj)); + priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (RAKIA_MEDIA_SESSION (obj)); g_assert (TP_IS_DBUS_DAEMON (priv->dbus_daemon)); tp_dbus_daemon_register_object (priv->dbus_daemon, priv->object_path, obj); @@ -215,8 +215,8 @@ static void rakia_media_session_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaMediaSession *session = TPSIP_MEDIA_SESSION (object); - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSession *session = RAKIA_MEDIA_SESSION (object); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); switch (property_id) { @@ -259,7 +259,7 @@ static void rakia_media_session_get_property (GObject *object, * At the moment, rawudp ignores all servers except the first one. */ GPtrArray *servers; gchar *stun_server = NULL; - guint stun_port = TPSIP_DEFAULT_STUN_PORT; + guint stun_port = RAKIA_DEFAULT_STUN_PORT; g_return_if_fail (priv->channel != NULL); @@ -303,8 +303,8 @@ static void rakia_media_session_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaMediaSession *session = TPSIP_MEDIA_SESSION (object); - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSession *session = RAKIA_MEDIA_SESSION (object); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); switch (property_id) { @@ -313,7 +313,7 @@ static void rakia_media_session_set_property (GObject *object, priv->dbus_daemon = g_value_dup_object (value); break; case PROP_MEDIA_CHANNEL: - priv->channel = TPSIP_MEDIA_CHANNEL (g_value_get_object (value)); + priv->channel = RAKIA_MEDIA_CHANNEL (g_value_get_object (value)); break; case PROP_OBJECT_PATH: g_assert (priv->object_path == NULL); @@ -366,7 +366,7 @@ rakia_media_session_class_init (RakiaMediaSessionClass *klass) param_spec = g_param_spec_object ("media-channel", "RakiaMediaChannel object", "SIP media channel object that owns this media session object" " (not reference counted).", - TPSIP_TYPE_MEDIA_CHANNEL, + RAKIA_TYPE_MEDIA_CHANNEL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MEDIA_CHANNEL, param_spec); @@ -449,8 +449,8 @@ rakia_media_session_class_init (RakiaMediaSessionClass *klass) static void rakia_media_session_dispose (GObject *object) { - RakiaMediaSession *self = TPSIP_MEDIA_SESSION (object); - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSession *self = RAKIA_MEDIA_SESSION (object); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); if (priv->dispose_has_run) return; @@ -473,8 +473,8 @@ rakia_media_session_dispose (GObject *object) static void rakia_media_session_finalize (GObject *object) { - RakiaMediaSession *self = TPSIP_MEDIA_SESSION (object); - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSession *self = RAKIA_MEDIA_SESSION (object); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); guint i; /* terminating the session should have discarded the NUA handle */ @@ -523,7 +523,7 @@ rakia_media_session_error (TpSvcMediaSessionHandler *iface, const gchar *message, DBusGMethodInvocation *context) { - RakiaMediaSession *obj = TPSIP_MEDIA_SESSION (iface); + RakiaMediaSession *obj = RAKIA_MEDIA_SESSION (iface); SESSION_DEBUG (obj, "Media.SessionHandler::Error called (%s), terminating session", message); @@ -568,13 +568,13 @@ static void rakia_media_session_ready (TpSvcMediaSessionHandler *iface, DBusGMethodInvocation *context) { - RakiaMediaSession *obj = TPSIP_MEDIA_SESSION (iface); + RakiaMediaSession *obj = RAKIA_MEDIA_SESSION (iface); RakiaMediaSessionPrivate *priv; guint i; DEBUG ("enter"); - priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (obj); + priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (obj); if (!priv->se_ready) { @@ -600,14 +600,14 @@ rakia_media_session_ready (TpSvcMediaSessionHandler *iface, TpHandle rakia_media_session_get_peer (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); return priv->peer; } RakiaMediaSessionState rakia_media_session_get_state (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); return priv->state; } @@ -626,7 +626,7 @@ rakia_media_session_supports_media_type (guint media_type) static void priv_close_all_streams (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); guint i; for (i = 0; i < priv->streams->len; i++) { @@ -642,7 +642,7 @@ static void priv_apply_streams_pending_direction (RakiaMediaSession *session, guint pending_send_mask) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); RakiaMediaStream *stream; guint i; @@ -664,7 +664,7 @@ void rakia_media_session_change_state (RakiaMediaSession *session, RakiaMediaSessionState new_state) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); guint old_state; if (priv->state == new_state) @@ -679,22 +679,22 @@ rakia_media_session_change_state (RakiaMediaSession *session, switch (new_state) { - case TPSIP_MEDIA_SESSION_STATE_CREATED: - case TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED: - case TPSIP_MEDIA_SESSION_STATE_INVITE_SENT: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_SENT: - case TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING: + case RAKIA_MEDIA_SESSION_STATE_CREATED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_SENT: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_SENT: + case RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING: break; - case TPSIP_MEDIA_SESSION_STATE_ACTIVE: + case RAKIA_MEDIA_SESSION_STATE_ACTIVE: /* Apply any pending remote send after outgoing INVITEs. * We don't want automatic removal of pending local send after * responding to incoming re-INVITEs, however */ priv_apply_streams_pending_direction (session, TP_MEDIA_STREAM_PENDING_REMOTE_SEND); break; - case TPSIP_MEDIA_SESSION_STATE_ENDED: + case RAKIA_MEDIA_SESSION_STATE_ENDED: priv_close_all_streams (session); DEBUG("destroying the NUA handle %p", priv->nua_op); if (priv->nua_op != NULL) @@ -710,7 +710,7 @@ rakia_media_session_change_state (RakiaMediaSession *session, g_signal_emit (session, signals[SIG_STATE_CHANGED], 0, old_state, new_state); - if (new_state == TPSIP_MEDIA_SESSION_STATE_ACTIVE && priv->pending_offer) + if (new_state == RAKIA_MEDIA_SESSION_STATE_ACTIVE && priv->pending_offer) priv_session_invite (session, TRUE); } @@ -726,7 +726,7 @@ rakia_media_session_debug (RakiaMediaSession *session, if (!rakia_debug_flag_is_set (DEBUG_FLAG)) return; - priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); va_start (list, format); @@ -741,11 +741,11 @@ rakia_media_session_debug (RakiaMediaSession *session, void rakia_media_session_terminate (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); DEBUG ("enter"); - if (priv->state == TPSIP_MEDIA_SESSION_STATE_ENDED) + if (priv->state == RAKIA_MEDIA_SESSION_STATE_ENDED) return; /* XXX: taken care of by the state change? */ @@ -757,22 +757,22 @@ void rakia_media_session_terminate (RakiaMediaSession *session) * (except freeing the saved event) upon nua_handle_destroy()? */ switch (priv->state) { - case TPSIP_MEDIA_SESSION_STATE_ACTIVE: - case TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_SENT: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING: + case RAKIA_MEDIA_SESSION_STATE_ACTIVE: + case RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_SENT: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING: DEBUG("sending BYE"); nua_bye (priv->nua_op, TAG_END()); break; - case TPSIP_MEDIA_SESSION_STATE_INVITE_SENT: + case RAKIA_MEDIA_SESSION_STATE_INVITE_SENT: DEBUG("sending CANCEL"); nua_cancel (priv->nua_op, TAG_END()); break; - case TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED: DEBUG("sending the 480 response to an incoming INVITE"); nua_respond (priv->nua_op, 480, "Terminated", TAG_END()); break; - case TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED: if (priv->saved_event[0]) { DEBUG("sending the 480 response to an incoming re-INVITE"); @@ -789,24 +789,24 @@ void rakia_media_session_terminate (RakiaMediaSession *session) } } - rakia_media_session_change_state (session, TPSIP_MEDIA_SESSION_STATE_ENDED); + rakia_media_session_change_state (session, RAKIA_MEDIA_SESSION_STATE_ENDED); } gboolean rakia_media_session_set_remote_media (RakiaMediaSession *session, const sdp_session_t* sdp) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); gboolean authoritative; DEBUG ("enter"); - if (priv->state == TPSIP_MEDIA_SESSION_STATE_INVITE_SENT - || priv->state == TPSIP_MEDIA_SESSION_STATE_REINVITE_SENT) + if (priv->state == RAKIA_MEDIA_SESSION_STATE_INVITE_SENT + || priv->state == RAKIA_MEDIA_SESSION_STATE_REINVITE_SENT) { rakia_media_session_change_state ( session, - TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED); + RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED); } else { @@ -848,8 +848,8 @@ rakia_media_session_set_remote_media (RakiaMediaSession *session, priv->remote_sdp = sdp_session_dup (priv->home, sdp); g_return_val_if_fail (priv->remote_sdp != NULL, FALSE); - authoritative = (priv->state == TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED - || priv->state == TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED); + authoritative = (priv->state == RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED + || priv->state == RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED); if (!priv_update_remote_media (session, authoritative)) return FALSE; @@ -865,7 +865,7 @@ priv_add_stream_list_entry (GPtrArray *list, RakiaMediaStream *stream, RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); GValue entry = { 0 }; GType stream_type; guint id; @@ -976,7 +976,7 @@ rakia_media_session_remove_streams (RakiaMediaSession *self, void rakia_media_session_list_streams (RakiaMediaSession *session, GPtrArray *ret) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); RakiaMediaStream *stream; guint i; @@ -994,7 +994,7 @@ rakia_media_session_request_stream_direction (RakiaMediaSession *self, guint direction, GError **error) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); RakiaMediaStream *stream; stream = rakia_media_session_get_stream (self, stream_id, error); @@ -1008,8 +1008,8 @@ rakia_media_session_request_stream_direction (RakiaMediaSession *self, SESSION_DEBUG (self, "direction %u requested for stream %u", direction, stream_id); - if (priv->state == TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED - || priv->state == TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED) + if (priv->state == RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED + || priv->state == RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED) { /* While processing a session offer, we can only mask out direction * requested by the remote peer */ @@ -1026,7 +1026,7 @@ rakia_media_session_request_stream_direction (RakiaMediaSession *self, static void priv_save_event (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); RakiaBaseConnection *conn = NULL; priv_zap_event (self); @@ -1051,7 +1051,7 @@ priv_save_event (RakiaMediaSession *self) static void priv_zap_event (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); if (priv->saved_event[0]) { @@ -1065,30 +1065,30 @@ priv_zap_event (RakiaMediaSession *self) void rakia_media_session_receive_invite (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); - g_return_if_fail (priv->state == TPSIP_MEDIA_SESSION_STATE_CREATED); + g_return_if_fail (priv->state == RAKIA_MEDIA_SESSION_STATE_CREATED); g_return_if_fail (priv->nua_op != NULL); priv->remote_initiated = TRUE; nua_respond (priv->nua_op, SIP_180_RINGING, TAG_END()); - rakia_media_session_change_state (self, TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED); + rakia_media_session_change_state (self, RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED); } void rakia_media_session_receive_reinvite (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); /* Check for permitted state transitions */ switch (priv->state) { - case TPSIP_MEDIA_SESSION_STATE_ACTIVE: - case TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_ACTIVE: + case RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: break; - case TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING: g_source_remove (priv->glare_timer_id); break; default: @@ -1097,13 +1097,13 @@ rakia_media_session_receive_reinvite (RakiaMediaSession *self) priv_save_event (self); - rakia_media_session_change_state (self, TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED); + rakia_media_session_change_state (self, RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED); } void rakia_media_session_accept (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); if (priv->accepted) return; @@ -1126,7 +1126,7 @@ rakia_media_session_respond (RakiaMediaSession *self, gint status, const char *message) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); SESSION_DEBUG (self, "responding: %03d %s", status, message ? message : ""); @@ -1139,7 +1139,7 @@ rakia_media_session_respond (RakiaMediaSession *self, gboolean rakia_media_session_is_accepted (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); return priv->accepted; } @@ -1147,11 +1147,11 @@ static gboolean priv_glare_retry (gpointer session) { RakiaMediaSession *self = session; - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); SESSION_DEBUG (self, "glare resolution interval is over"); - if (priv->state == TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING) + if (priv->state == RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING) priv_session_invite (self, TRUE); /* Reap the timer */ @@ -1162,10 +1162,10 @@ priv_glare_retry (gpointer session) void rakia_media_session_resolve_glare (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); guint interval; - if (priv->state != TPSIP_MEDIA_SESSION_STATE_REINVITE_SENT) + if (priv->state != RAKIA_MEDIA_SESSION_STATE_REINVITE_SENT) { SESSION_DEBUG (self, "glare resolution triggered in unexpected state"); return; @@ -1196,7 +1196,7 @@ rakia_media_session_resolve_glare (RakiaMediaSession *self) SESSION_DEBUG (self, "glare resolution interval %u msec", interval); rakia_media_session_change_state ( - self, TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING); + self, RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING); } static RakiaMediaStream * @@ -1204,7 +1204,7 @@ rakia_media_session_get_stream (RakiaMediaSession *self, guint stream_id, GError **error) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); RakiaMediaStream *stream; g_assert (priv->streams != NULL); @@ -1231,14 +1231,14 @@ rakia_media_session_get_stream (RakiaMediaSession *self, TpLocalHoldState rakia_media_session_get_hold_state (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); return priv->hold_state; } static gboolean rakia_media_session_is_local_hold_ongoing (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); return (priv->hold_state == TP_LOCAL_HOLD_STATE_HELD || priv->hold_state == TP_LOCAL_HOLD_STATE_PENDING_HOLD); } @@ -1248,7 +1248,7 @@ priv_initiate_hold (RakiaMediaSession *self, gboolean hold, TpLocalHoldStateReason reason) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); gboolean stream_hold_requested = FALSE; RakiaMediaStream *stream; guint i; @@ -1303,7 +1303,7 @@ priv_initiate_hold (RakiaMediaSession *self, static void priv_finalize_hold (RakiaMediaSession *self) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); RakiaMediaStream *stream; TpLocalHoldState final_hold_state; guint hold_mask; @@ -1435,7 +1435,7 @@ gint rakia_media_session_rate_native_transport (RakiaMediaSession *session, const GValue *transport) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); gint result = 0; gchar *address = NULL; guint proto = TP_MEDIA_STREAM_BASE_PROTO_UDP; @@ -1462,7 +1462,7 @@ rakia_media_session_rate_native_transport (RakiaMediaSession *session, static void priv_session_set_streams_playing (RakiaMediaSession *session, gboolean playing) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); RakiaMediaStream *stream; guint i; @@ -1477,16 +1477,16 @@ priv_session_set_streams_playing (RakiaMediaSession *session, gboolean playing) static void priv_local_media_changed (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); switch (priv->state) { - case TPSIP_MEDIA_SESSION_STATE_CREATED: + case RAKIA_MEDIA_SESSION_STATE_CREATED: /* If all streams are ready, send an offer now */ priv_request_response_step (session); break; - case TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED: /* The changes to existing streams will be included in the * eventual answer (FIXME: implement postponed direction changes, * which are applied after the remote offer has been processed). @@ -1495,13 +1495,13 @@ priv_local_media_changed (RakiaMediaSession *session) if (priv->remote_stream_count < priv->streams->len) priv->pending_offer = TRUE; break; - case TPSIP_MEDIA_SESSION_STATE_INVITE_SENT: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_SENT: - case TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_SENT: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_SENT: + case RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: /* Cannot send another offer right now */ priv->pending_offer = TRUE; break; - case TPSIP_MEDIA_SESSION_STATE_ACTIVE: + case RAKIA_MEDIA_SESSION_STATE_ACTIVE: /* Check if we are allowed to send re-INVITES */ { gboolean immutable_streams = FALSE; @@ -1514,7 +1514,7 @@ priv_local_media_changed (RakiaMediaSession *session) } } /* Fall through to the next case */ - case TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING: if (priv->local_non_ready == 0) priv_session_invite (session, TRUE); else @@ -1528,7 +1528,7 @@ priv_local_media_changed (RakiaMediaSession *session) static void priv_update_remote_hold (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); RakiaMediaStream *stream; gboolean has_streams = FALSE; gboolean remote_held = TRUE; @@ -1582,7 +1582,7 @@ rakia_sdp_get_string_attribute (const sdp_attribute_t *attrs, const char *name) static gboolean priv_update_remote_media (RakiaMediaSession *session, gboolean authoritative) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); const sdp_session_t *sdp = priv->remote_sdp; const sdp_media_t *media; gboolean has_supported_media = FALSE; @@ -1714,7 +1714,7 @@ priv_update_remote_media (RakiaMediaSession *session, gboolean authoritative) static void priv_session_rollback (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); DEBUG("enter"); @@ -1753,7 +1753,7 @@ priv_session_rollback (RakiaMediaSession *session) TAG_END()); } - rakia_media_session_change_state (session, TPSIP_MEDIA_SESSION_STATE_ACTIVE); + rakia_media_session_change_state (session, RAKIA_MEDIA_SESSION_STATE_ACTIVE); } static gboolean @@ -1761,7 +1761,7 @@ priv_session_local_sdp (RakiaMediaSession *session, GString *user_sdp, gboolean authoritative) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); gboolean has_supported_media = FALSE; guint len; guint i; @@ -1798,7 +1798,7 @@ priv_session_local_sdp (RakiaMediaSession *session, static void priv_session_invite (RakiaMediaSession *session, gboolean reinvite) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); GString *user_sdp; DEBUG("enter"); @@ -1819,14 +1819,14 @@ priv_session_invite (RakiaMediaSession *session, gboolean reinvite) SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL), NUTAG_AUTOANSWER(0), TAG_IF(reinvite, - NUTAG_INVITE_TIMER (TPSIP_REINVITE_TIMEOUT)), + NUTAG_INVITE_TIMER (RAKIA_REINVITE_TIMEOUT)), TAG_END()); priv->pending_offer = FALSE; rakia_media_session_change_state ( session, - reinvite? TPSIP_MEDIA_SESSION_STATE_REINVITE_SENT - : TPSIP_MEDIA_SESSION_STATE_INVITE_SENT); + reinvite? RAKIA_MEDIA_SESSION_STATE_REINVITE_SENT + : RAKIA_MEDIA_SESSION_STATE_INVITE_SENT); } else WARNING ("cannot send a valid SDP offer, are there no streams?"); @@ -1837,7 +1837,7 @@ priv_session_invite (RakiaMediaSession *session, gboolean reinvite) static void priv_session_respond (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); GString *user_sdp; g_return_if_fail (priv->nua_op != NULL); @@ -1866,7 +1866,7 @@ priv_session_respond (RakiaMediaSession *session) if (priv->saved_event[0]) nua_destroy_event (priv->saved_event); - rakia_media_session_change_state (session, TPSIP_MEDIA_SESSION_STATE_ACTIVE); + rakia_media_session_change_state (session, RAKIA_MEDIA_SESSION_STATE_ACTIVE); } else { @@ -1881,7 +1881,7 @@ priv_session_respond (RakiaMediaSession *session) static gboolean priv_is_codec_intersect_pending (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); guint i; for (i = 0; i < priv->streams->len; i++) @@ -1907,7 +1907,7 @@ priv_is_codec_intersect_pending (RakiaMediaSession *session) static void priv_request_response_step (RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); if (priv->local_non_ready != 0) { @@ -1917,16 +1917,16 @@ priv_request_response_step (RakiaMediaSession *session) switch (priv->state) { - case TPSIP_MEDIA_SESSION_STATE_CREATED: + case RAKIA_MEDIA_SESSION_STATE_CREATED: priv_session_invite (session, FALSE); break; - case TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: if (priv->accepted && !priv_is_codec_intersect_pending (session)) rakia_media_session_change_state (session, - TPSIP_MEDIA_SESSION_STATE_ACTIVE); + RAKIA_MEDIA_SESSION_STATE_ACTIVE); break; - case TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED: /* TODO: if the call has not yet been accepted locally * and the remote endpoint supports 100rel, send them * an early session answer in a reliable 183 response */ @@ -1934,12 +1934,12 @@ priv_request_response_step (RakiaMediaSession *session) && !priv_is_codec_intersect_pending (session)) priv_session_respond (session); break; - case TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED: if (!priv_is_codec_intersect_pending (session)) priv_session_respond (session); break; - case TPSIP_MEDIA_SESSION_STATE_ACTIVE: - case TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING: + case RAKIA_MEDIA_SESSION_STATE_ACTIVE: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING: if (priv->pending_offer) priv_session_invite (session, TRUE); break; @@ -1957,7 +1957,7 @@ priv_stream_close_cb (RakiaMediaStream *stream, DEBUG("enter"); - priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); id = rakia_media_stream_get_id (stream); g_return_if_fail (g_ptr_array_index(priv->streams, id) == stream); @@ -1983,7 +1983,7 @@ static void priv_stream_ready_cb (RakiaMediaStream *stream, DEBUG ("enter"); - priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); g_assert (priv->local_non_ready > 0); --priv->local_non_ready; @@ -1997,7 +1997,7 @@ static void priv_stream_supported_codecs_cb (RakiaMediaStream *stream, { RakiaMediaSessionPrivate *priv; - priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); g_assert (!rakia_media_stream_is_codec_intersect_pending (stream)); @@ -2006,21 +2006,21 @@ static void priv_stream_supported_codecs_cb (RakiaMediaStream *stream, /* This remote media description got no codec intersection. */ switch (priv->state) { - case TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: - case TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED: DEBUG("no codec intersection, closing the stream"); rakia_media_stream_close (stream); break; - case TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED: + case RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED: /* In this case, we have the stream negotiated already, * and we don't want to close it just because the remote party * offers a different set of codecs. * Roll back the whole session to the previously negotiated state. */ priv_session_rollback (session); return; - case TPSIP_MEDIA_SESSION_STATE_ACTIVE: + case RAKIA_MEDIA_SESSION_STATE_ACTIVE: /* We've most likely rolled back from - * TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED, + * RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED, * but we may receive more than one empty codec intersection * in the session, so we ignore the rest */ return; @@ -2037,7 +2037,7 @@ priv_stream_state_changed_cb (RakiaMediaStream *stream, guint state, RakiaMediaChannel *channel) { - g_assert (TPSIP_IS_MEDIA_CHANNEL (channel)); + g_assert (RAKIA_IS_MEDIA_CHANNEL (channel)); tp_svc_channel_type_streamed_media_emit_stream_state_changed( channel, rakia_media_stream_get_id (stream), state); @@ -2049,7 +2049,7 @@ priv_stream_direction_changed_cb (RakiaMediaStream *stream, guint pending_send_flags, RakiaMediaChannel *channel) { - g_assert (TPSIP_IS_MEDIA_CHANNEL (channel)); + g_assert (RAKIA_IS_MEDIA_CHANNEL (channel)); tp_svc_channel_type_streamed_media_emit_stream_direction_changed ( channel, rakia_media_stream_get_id (stream), direction, pending_send_flags); @@ -2060,7 +2060,7 @@ priv_stream_hold_state_cb (RakiaMediaStream *stream, GParamSpec *pspec, RakiaMediaSession *session) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (session); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (session); gboolean hold; guint i; @@ -2115,7 +2115,7 @@ rakia_media_session_add_stream (RakiaMediaSession *self, TpMediaStreamDirection direction, gboolean created_locally) { - RakiaMediaSessionPrivate *priv = TPSIP_MEDIA_SESSION_GET_PRIVATE (self); + RakiaMediaSessionPrivate *priv = RAKIA_MEDIA_SESSION_GET_PRIVATE (self); RakiaMediaStream *stream = NULL; DEBUG ("enter"); @@ -2139,7 +2139,7 @@ rakia_media_session_add_stream (RakiaMediaSession *self, if (rakia_media_session_is_local_hold_ongoing (self)) direction &= ~TP_MEDIA_STREAM_DIRECTION_RECEIVE; - stream = g_object_new (TPSIP_TYPE_MEDIA_STREAM, + stream = g_object_new (RAKIA_TYPE_MEDIA_STREAM, "dbus-daemon", priv->dbus_daemon, "media-session", self, "media-type", media_type, diff --git a/rakia/media-session.h b/rakia/media-session.h index 158e23b..222f663 100644 --- a/rakia/media-session.h +++ b/rakia/media-session.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_MEDIA_SESSION_H__ -#define __TPSIP_MEDIA_SESSION_H__ +#ifndef __RAKIA_MEDIA_SESSION_H__ +#define __RAKIA_MEDIA_SESSION_H__ #include <rakia/media-stream.h> @@ -30,15 +30,15 @@ G_BEGIN_DECLS typedef enum { - TPSIP_MEDIA_SESSION_STATE_CREATED = 0, - TPSIP_MEDIA_SESSION_STATE_INVITE_SENT, - TPSIP_MEDIA_SESSION_STATE_INVITE_RECEIVED, - TPSIP_MEDIA_SESSION_STATE_RESPONSE_RECEIVED, - TPSIP_MEDIA_SESSION_STATE_ACTIVE, - TPSIP_MEDIA_SESSION_STATE_REINVITE_SENT, - TPSIP_MEDIA_SESSION_STATE_REINVITE_RECEIVED, - TPSIP_MEDIA_SESSION_STATE_REINVITE_PENDING, - TPSIP_MEDIA_SESSION_STATE_ENDED + RAKIA_MEDIA_SESSION_STATE_CREATED = 0, + RAKIA_MEDIA_SESSION_STATE_INVITE_SENT, + RAKIA_MEDIA_SESSION_STATE_INVITE_RECEIVED, + RAKIA_MEDIA_SESSION_STATE_RESPONSE_RECEIVED, + RAKIA_MEDIA_SESSION_STATE_ACTIVE, + RAKIA_MEDIA_SESSION_STATE_REINVITE_SENT, + RAKIA_MEDIA_SESSION_STATE_REINVITE_RECEIVED, + RAKIA_MEDIA_SESSION_STATE_REINVITE_PENDING, + RAKIA_MEDIA_SESSION_STATE_ENDED } RakiaMediaSessionState; typedef struct _RakiaMediaSession RakiaMediaSession; @@ -55,18 +55,18 @@ struct _RakiaMediaSession { GType rakia_media_session_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_MEDIA_SESSION \ +#define RAKIA_TYPE_MEDIA_SESSION \ (rakia_media_session_get_type()) -#define TPSIP_MEDIA_SESSION(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_MEDIA_SESSION, RakiaMediaSession)) -#define TPSIP_MEDIA_SESSION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_MEDIA_SESSION, RakiaMediaSessionClass)) -#define TPSIP_IS_MEDIA_SESSION(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_MEDIA_SESSION)) -#define TPSIP_IS_MEDIA_SESSION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_MEDIA_SESSION)) -#define TPSIP_MEDIA_SESSION_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_MEDIA_SESSION, RakiaMediaSessionClass)) +#define RAKIA_MEDIA_SESSION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_MEDIA_SESSION, RakiaMediaSession)) +#define RAKIA_MEDIA_SESSION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_MEDIA_SESSION, RakiaMediaSessionClass)) +#define RAKIA_IS_MEDIA_SESSION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_MEDIA_SESSION)) +#define RAKIA_IS_MEDIA_SESSION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_MEDIA_SESSION)) +#define RAKIA_MEDIA_SESSION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_MEDIA_SESSION, RakiaMediaSessionClass)) /*********************************************************************** * Additional declarations (not based on generated templates) @@ -140,4 +140,4 @@ void rakia_media_session_debug (RakiaMediaSession *session, G_END_DECLS -#endif /* #ifndef __TPSIP_MEDIA_SESSION_H__*/ +#endif /* #ifndef __RAKIA_MEDIA_SESSION_H__*/ diff --git a/rakia/media-stream.c b/rakia/media-stream.c index f8f659e..eaa60e0 100644 --- a/rakia/media-stream.c +++ b/rakia/media-stream.c @@ -49,7 +49,7 @@ #include "signals-marshal.h" -#define DEBUG_FLAG TPSIP_DEBUG_MEDIA +#define DEBUG_FLAG RAKIA_DEBUG_MEDIA #include "rakia/debug.h" @@ -145,7 +145,7 @@ struct _RakiaMediaStreamPrivate gboolean dispose_has_run; }; -#define TPSIP_MEDIA_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_MEDIA_STREAM, RakiaMediaStreamPrivate)) +#define RAKIA_MEDIA_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_MEDIA_STREAM, RakiaMediaStreamPrivate)) static void push_remote_codecs (RakiaMediaStream *stream); static void push_remote_candidates (RakiaMediaStream *stream); @@ -177,7 +177,7 @@ static const char *debug_tp_transports[] = { static void rakia_media_stream_init (RakiaMediaStream *self) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); priv->playing = FALSE; priv->sending = FALSE; @@ -200,8 +200,8 @@ rakia_media_stream_init (RakiaMediaStream *self) static void rakia_media_stream_constructed (GObject *obj) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE ( - TPSIP_MEDIA_STREAM (obj)); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE ( + RAKIA_MEDIA_STREAM (obj)); GObjectClass *parent_object_class = G_OBJECT_CLASS (rakia_media_stream_parent_class); @@ -233,8 +233,8 @@ rakia_media_stream_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaMediaStream *stream = TPSIP_MEDIA_STREAM (object); - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + RakiaMediaStream *stream = RAKIA_MEDIA_STREAM (object); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); switch (property_id) { @@ -289,8 +289,8 @@ rakia_media_stream_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaMediaStream *stream = TPSIP_MEDIA_STREAM (object); - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + RakiaMediaStream *stream = RAKIA_MEDIA_STREAM (object); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); switch (property_id) { @@ -375,7 +375,7 @@ rakia_media_stream_class_init (RakiaMediaStreamClass *klass) param_spec = g_param_spec_object ("media-session", "RakiaMediaSession object", "SIP media session object that owns this media stream object.", - TPSIP_TYPE_MEDIA_SESSION, + RAKIA_TYPE_MEDIA_SESSION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MEDIA_SESSION, param_spec); @@ -523,8 +523,8 @@ rakia_media_stream_class_init (RakiaMediaStreamClass *klass) void rakia_media_stream_dispose (GObject *object) { - RakiaMediaStream *self = TPSIP_MEDIA_STREAM (object); - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStream *self = RAKIA_MEDIA_STREAM (object); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); if (priv->dispose_has_run) return; @@ -542,8 +542,8 @@ rakia_media_stream_dispose (GObject *object) void rakia_media_stream_finalize (GObject *object) { - RakiaMediaStream *self = TPSIP_MEDIA_STREAM (object); - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStream *self = RAKIA_MEDIA_STREAM (object); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); /* free any data held directly by the object here */ g_free (priv->object_path); @@ -597,7 +597,7 @@ rakia_media_stream_error (TpSvcMediaStreamHandler *iface, { DEBUG("StreamHandler.Error called: %u %s", errno, message); - rakia_media_stream_close (TPSIP_MEDIA_STREAM (iface)); + rakia_media_stream_close (RAKIA_MEDIA_STREAM (iface)); tp_svc_media_stream_handler_return_from_error (context); } @@ -616,10 +616,10 @@ rakia_media_stream_native_candidates_prepared (TpSvcMediaStreamHandler *iface, * have been discovered for the moment." */ - RakiaMediaStream *obj = TPSIP_MEDIA_STREAM (iface); + RakiaMediaStream *obj = RAKIA_MEDIA_STREAM (iface); RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (obj); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (obj); DEBUG("enter"); @@ -646,10 +646,10 @@ rakia_media_stream_new_active_candidate_pair (TpSvcMediaStreamHandler *iface, const gchar *remote_candidate_id, DBusGMethodInvocation *context) { - RakiaMediaStream *obj = TPSIP_MEDIA_STREAM (iface); + RakiaMediaStream *obj = RAKIA_MEDIA_STREAM (iface); RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (obj); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (obj); DEBUG("stream engine reported new active candidate pair %s-%s", native_candidate_id, remote_candidate_id); @@ -683,14 +683,14 @@ rakia_media_stream_new_native_candidate (TpSvcMediaStreamHandler *iface, const GPtrArray *transports, DBusGMethodInvocation *context) { - RakiaMediaStream *obj = TPSIP_MEDIA_STREAM (iface); + RakiaMediaStream *obj = RAKIA_MEDIA_STREAM (iface); RakiaMediaStreamPrivate *priv; GPtrArray *candidates; GValue candidate = { 0, }; GValue transport = { 0, }; gint tr_goodness; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (obj); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (obj); if (priv->stream_sdp != NULL) { @@ -742,7 +742,7 @@ static void priv_set_local_codecs (RakiaMediaStream *self, const GPtrArray *codecs) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); GValue val = { 0, }; SESSION_DEBUG(priv->session, "putting list of %d locally supported " @@ -761,8 +761,8 @@ rakia_media_stream_codecs_updated (TpSvcMediaStreamHandler *iface, const GPtrArray *codecs, DBusGMethodInvocation *context) { - RakiaMediaStream *self = TPSIP_MEDIA_STREAM (iface); - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStream *self = RAKIA_MEDIA_STREAM (iface); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); if (!priv->native_codecs_prepared) { @@ -814,12 +814,12 @@ rakia_media_stream_ready (TpSvcMediaStreamHandler *iface, * candidates first */ - RakiaMediaStream *obj = TPSIP_MEDIA_STREAM (iface); + RakiaMediaStream *obj = RAKIA_MEDIA_STREAM (iface); RakiaMediaStreamPrivate *priv; DEBUG ("enter"); - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (obj); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (obj); if (priv->ready_received) { @@ -866,7 +866,7 @@ rakia_media_stream_set_local_codecs (TpSvcMediaStreamHandler *iface, const GPtrArray *codecs, DBusGMethodInvocation *context) { - priv_set_local_codecs (TPSIP_MEDIA_STREAM (iface), codecs); + priv_set_local_codecs (RAKIA_MEDIA_STREAM (iface), codecs); tp_svc_media_stream_handler_return_from_set_local_codecs (context); } @@ -887,9 +887,9 @@ rakia_media_stream_stream_state (TpSvcMediaStreamHandler *iface, * - set the stream state for session */ - RakiaMediaStream *obj = TPSIP_MEDIA_STREAM (iface); + RakiaMediaStream *obj = RAKIA_MEDIA_STREAM (iface); RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (obj); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (obj); if (priv->state != state) { @@ -921,9 +921,9 @@ rakia_media_stream_supported_codecs (TpSvcMediaStreamHandler *iface, * - emit SupportedCodecs */ - RakiaMediaStream *self = TPSIP_MEDIA_STREAM (iface); + RakiaMediaStream *self = RAKIA_MEDIA_STREAM (iface); RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); DEBUG("got codec intersection containing %u codecs from stream-engine", codecs->len); @@ -982,14 +982,14 @@ rakia_media_stream_unhold_failure (TpSvcMediaStreamHandler *self, guint rakia_media_stream_get_id (RakiaMediaStream *self) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); return priv->id; } guint rakia_media_stream_get_media_type (RakiaMediaStream *self) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); return priv->media_type; } @@ -1006,7 +1006,7 @@ rakia_media_stream_close (RakiaMediaStream *self) const char *rakia_media_stream_local_sdp (RakiaMediaStream *obj) { RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (obj); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (obj); return priv->stream_sdp; } @@ -1077,7 +1077,7 @@ rakia_media_stream_set_remote_media (RakiaMediaStream *stream, DEBUG ("enter"); - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); /* Do sanity checks */ @@ -1210,7 +1210,7 @@ rakia_tp_media_type (sdp_media_e sip_mtype) void rakia_media_stream_set_playing (RakiaMediaStream *stream, gboolean playing) { RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); if (same_boolean (priv->playing, playing)) return; @@ -1232,7 +1232,7 @@ void rakia_media_stream_set_sending (RakiaMediaStream *stream, gboolean sending) { RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); if (same_boolean(priv->sending, sending)) return; @@ -1250,7 +1250,7 @@ static void priv_update_sending (RakiaMediaStream *stream, TpMediaStreamDirection direction) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); gboolean sending = TRUE; /* XXX: the pending send flag check is probably an overkill @@ -1276,7 +1276,7 @@ rakia_media_stream_set_direction (RakiaMediaStream *stream, guint pending_send_flags; TpMediaStreamDirection old_sdp_direction; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); pending_send_flags = priv->pending_send_flags & pending_send_mask; if ((direction & ~priv->direction & TP_MEDIA_STREAM_DIRECTION_SEND) != 0) @@ -1346,7 +1346,7 @@ void rakia_media_stream_apply_pending_direction (RakiaMediaStream *stream, guint pending_send_mask) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); guint flags; @@ -1382,7 +1382,7 @@ rakia_media_stream_apply_pending_direction (RakiaMediaStream *stream, TpMediaStreamDirection rakia_media_stream_get_requested_direction (RakiaMediaStream *self) { - return priv_get_requested_direction (TPSIP_MEDIA_STREAM_GET_PRIVATE (self)); + return priv_get_requested_direction (RAKIA_MEDIA_STREAM_GET_PRIVATE (self)); } /** @@ -1392,7 +1392,7 @@ rakia_media_stream_get_requested_direction (RakiaMediaStream *self) gboolean rakia_media_stream_is_local_ready (RakiaMediaStream *self) { RakiaMediaStreamPrivate *priv; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); g_assert (priv->stream_sdp == NULL || priv->ready_received); return (priv->stream_sdp != NULL); } @@ -1400,7 +1400,7 @@ gboolean rakia_media_stream_is_local_ready (RakiaMediaStream *self) gboolean rakia_media_stream_is_codec_intersect_pending (RakiaMediaStream *self) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); return priv->codec_intersect_pending; } @@ -1421,7 +1421,7 @@ rakia_media_stream_stop_telephony_event (RakiaMediaStream *self) gboolean rakia_media_stream_request_hold_state (RakiaMediaStream *self, gboolean hold) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); if ((!priv->requested_hold_state) != (!hold)) { @@ -1435,7 +1435,7 @@ rakia_media_stream_request_hold_state (RakiaMediaStream *self, gboolean hold) static void priv_generate_sdp (RakiaMediaStream *self) { - RakiaMediaStreamPrivate *priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (self); + RakiaMediaStreamPrivate *priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (self); if (priv->stream_sdp != NULL) return; @@ -1466,7 +1466,7 @@ static void push_remote_codecs (RakiaMediaStream *stream) DEBUG ("enter"); - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); sdpmedia = priv->remote_media; if (sdpmedia == NULL) @@ -1583,7 +1583,7 @@ static void push_remote_candidates (RakiaMediaStream *stream) DEBUG("enter"); - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); media = priv->remote_media; if (media == NULL) @@ -1714,7 +1714,7 @@ push_active_candidate_pair (RakiaMediaStream *stream) DEBUG("enter"); - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); if (priv->ready_received && priv->native_candidate_id != NULL @@ -1828,7 +1828,7 @@ priv_update_local_sdp(RakiaMediaStream *stream) const gchar *dirline; int i; - priv = TPSIP_MEDIA_STREAM_GET_PRIVATE (stream); + priv = RAKIA_MEDIA_STREAM_GET_PRIVATE (stream); candidates = g_value_get_boxed (&priv->native_candidates); diff --git a/rakia/media-stream.h b/rakia/media-stream.h index 0e09a42..35d9846 100644 --- a/rakia/media-stream.h +++ b/rakia/media-stream.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_MEDIA_STREAM_H__ -#define __TPSIP_MEDIA_STREAM_H__ +#ifndef __RAKIA_MEDIA_STREAM_H__ +#define __RAKIA_MEDIA_STREAM_H__ #include <glib-object.h> #include <telepathy-glib/dbus-properties-mixin.h> @@ -43,18 +43,18 @@ struct _RakiaMediaStream { GType rakia_media_stream_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_MEDIA_STREAM \ +#define RAKIA_TYPE_MEDIA_STREAM \ (rakia_media_stream_get_type()) -#define TPSIP_MEDIA_STREAM(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_MEDIA_STREAM, RakiaMediaStream)) -#define TPSIP_MEDIA_STREAM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_MEDIA_STREAM, RakiaMediaStreamClass)) -#define TPSIP_IS_MEDIA_STREAM(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_MEDIA_STREAM)) -#define TPSIP_IS_MEDIA_STREAM_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_MEDIA_STREAM)) -#define TPSIP_MEDIA_STREAM_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_MEDIA_STREAM, RakiaMediaStreamClass)) +#define RAKIA_MEDIA_STREAM(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_MEDIA_STREAM, RakiaMediaStream)) +#define RAKIA_MEDIA_STREAM_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_MEDIA_STREAM, RakiaMediaStreamClass)) +#define RAKIA_IS_MEDIA_STREAM(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_MEDIA_STREAM)) +#define RAKIA_IS_MEDIA_STREAM_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_MEDIA_STREAM)) +#define RAKIA_MEDIA_STREAM_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_MEDIA_STREAM, RakiaMediaStreamClass)) /*********************************************************************** * Additional declarations (not based on generated templates) @@ -89,4 +89,4 @@ TpMediaStreamDirection rakia_media_stream_direction_from_remote_media ( G_END_DECLS -#endif /* #ifndef __TPSIP_MEDIA_STREAM_H__*/ +#endif /* #ifndef __RAKIA_MEDIA_STREAM_H__*/ diff --git a/rakia/sofia-decls.h b/rakia/sofia-decls.h index 7f04e24..565d798 100644 --- a/rakia/sofia-decls.h +++ b/rakia/sofia-decls.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _TPSIP_SOFIA_DECLS_H_ -#define _TPSIP_SOFIA_DECLS_H_ +#ifndef _RAKIA_SOFIA_DECLS_H_ +#define _RAKIA_SOFIA_DECLS_H_ /* note: As one Sofia-SIP NUA instance is created per SIP connection, * RakiaConnection is used as the context pointer. @@ -39,12 +39,12 @@ #define SU_TIMER_ARG_T struct _RakiaBaseConnection #define SU_WAKEUP_ARG_T void -#define TPSIP_DEFAULT_STUN_PORT 3478 +#define RAKIA_DEFAULT_STUN_PORT 3478 /* Maximum defer timeout for deferrable Sofia timers */ -#define TPSIP_DEFER_TIMEOUT 30 +#define RAKIA_DEFER_TIMEOUT 30 #include <sofia-sip/nua.h> #include <sofia-sip/su.h> -#endif /* _TPSIP_SOFIA_DECLS_H_*/ +#endif /* _RAKIA_SOFIA_DECLS_H_*/ diff --git a/rakia/text-channel.c b/rakia/text-channel.c index 2d55c25..3728d11 100644 --- a/rakia/text-channel.c +++ b/rakia/text-channel.c @@ -46,7 +46,7 @@ #include <sofia-sip/sip_protos.h> #include <sofia-sip/sip_status.h> -#define DEBUG_FLAG TPSIP_DEBUG_IM +#define DEBUG_FLAG RAKIA_DEBUG_IM #include "rakia/debug.h" static gboolean @@ -59,7 +59,7 @@ static void channel_iface_init (gpointer, gpointer); static void destroyable_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (RakiaTextChannel, rakia_text_channel, G_TYPE_OBJECT, - G_IMPLEMENT_INTERFACE (TPSIP_TYPE_EVENT_TARGET, NULL); + G_IMPLEMENT_INTERFACE (RAKIA_TYPE_EVENT_TARGET, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init); @@ -129,7 +129,7 @@ struct _RakiaTextChannelPrivate #define _rakia_text_pending_new0() \ (g_slice_new0(RakiaTextPendingMessage)) -#define TPSIP_TEXT_CHANNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_TEXT_CHANNEL, RakiaTextChannelPrivate)) +#define RAKIA_TEXT_CHANNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_TEXT_CHANNEL, RakiaTextChannelPrivate)) static void rakia_text_pending_free (RakiaTextPendingMessage *msg, TpHandleRepoIface *contact_handles) @@ -145,7 +145,7 @@ static void rakia_text_pending_free (RakiaTextPendingMessage *msg, static void rakia_text_channel_init (RakiaTextChannel *obj) { - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (obj); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (obj); DEBUG("enter"); @@ -176,7 +176,7 @@ rakia_text_channel_constructed (GObject *obj) if (parent_object_class->constructed != NULL) parent_object_class->constructed (obj); - priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE(TPSIP_TEXT_CHANNEL(obj)); + priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE(RAKIA_TEXT_CHANNEL(obj)); base_conn = (TpBaseConnection *) priv->conn; contact_handles = tp_base_connection_get_handles (base_conn, TP_HANDLE_TYPE_CONTACT); @@ -186,7 +186,7 @@ rakia_text_channel_constructed (GObject *obj) g_assert (priv->initiator != 0); tp_handle_ref (contact_handles, priv->initiator); - rakia_base_connection_add_auth_handler (priv->conn, TPSIP_EVENT_TARGET (obj)); + rakia_base_connection_add_auth_handler (priv->conn, RAKIA_EVENT_TARGET (obj)); g_signal_connect (obj, "nua-event::nua_r_message", @@ -271,7 +271,7 @@ rakia_text_channel_class_init(RakiaTextChannelClass *klass) param_spec = g_param_spec_object("connection", "RakiaConnection object", "SIP connection object that owns this SIP media channel object.", - TPSIP_TYPE_BASE_CONNECTION, + RAKIA_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property(object_class, PROP_CONNECTION, param_spec); @@ -320,8 +320,8 @@ rakia_text_channel_get_property(GObject *object, GValue *value, GParamSpec *pspec) { - RakiaTextChannel *chan = TPSIP_TEXT_CHANNEL(object); - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE(chan); + RakiaTextChannel *chan = RAKIA_TEXT_CHANNEL(object); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE(chan); TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn; switch (property_id) @@ -411,8 +411,8 @@ rakia_text_channel_set_property(GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaTextChannel *chan = TPSIP_TEXT_CHANNEL (object); - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (chan); + RakiaTextChannel *chan = RAKIA_TEXT_CHANNEL (object); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (chan); switch (property_id) { @@ -450,8 +450,8 @@ rakia_text_channel_set_property(GObject *object, static void rakia_text_channel_dispose(GObject *object) { - RakiaTextChannel *self = TPSIP_TEXT_CHANNEL (object); - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (self); + RakiaTextChannel *self = RAKIA_TEXT_CHANNEL (object); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (self); TpHandleRepoIface *contact_handles; if (priv->dispose_has_run) @@ -489,8 +489,8 @@ zap_pending_messages (GQueue *pending_messages, static void rakia_text_channel_finalize(GObject *object) { - RakiaTextChannel *self = TPSIP_TEXT_CHANNEL (object); - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (self); + RakiaTextChannel *self = RAKIA_TEXT_CHANNEL (object); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (self); TpHandleRepoIface *contact_handles; contact_handles = tp_base_connection_get_handles ( @@ -526,8 +526,8 @@ static void rakia_text_channel_close (TpSvcChannel *iface, DBusGMethodInvocation *context) { - RakiaTextChannel *self = TPSIP_TEXT_CHANNEL (iface); - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE(self); + RakiaTextChannel *self = RAKIA_TEXT_CHANNEL (iface); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE(self); if (priv->closed) { @@ -574,8 +574,8 @@ static void rakia_text_channel_destroy (TpSvcChannelInterfaceDestroyable *iface, DBusGMethodInvocation *context) { - RakiaTextChannel *self = TPSIP_TEXT_CHANNEL (iface); - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (self); + RakiaTextChannel *self = RAKIA_TEXT_CHANNEL (iface); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (self); TpHandleRepoIface *contact_handles; contact_handles = tp_base_connection_get_handles ( @@ -615,12 +615,12 @@ static void rakia_text_channel_get_handle (TpSvcChannel *iface, DBusGMethodInvocation *context) { - RakiaTextChannel *obj = TPSIP_TEXT_CHANNEL (iface); + RakiaTextChannel *obj = RAKIA_TEXT_CHANNEL (iface); RakiaTextChannelPrivate *priv; DEBUG("enter"); - priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE(obj); + priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE(obj); tp_svc_channel_return_from_get_handle (context, TP_HANDLE_TYPE_CONTACT, priv->handle); @@ -647,8 +647,8 @@ rakia_text_channel_send_message (GObject *object, TpMessage *message, TpMessageSendingFlags flags) { - RakiaTextChannel *self = TPSIP_TEXT_CHANNEL(object); - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (self); + RakiaTextChannel *self = RAKIA_TEXT_CHANNEL(object); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (self); RakiaTextPendingMessage *msg = NULL; nua_handle_t *msg_nh = NULL; GError *error = NULL; @@ -760,7 +760,7 @@ delivery_report (RakiaTextChannel *self, TpDeliveryStatus status, TpChannelTextSendError send_error) { - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (self); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (self); TpBaseConnection *base_conn; TpMessage *msg; @@ -796,7 +796,7 @@ rakia_text_channel_nua_r_message_cb (RakiaTextChannel *self, tagi_t tags[], gpointer foo) { - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (self); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (self); RakiaTextPendingMessage *msg; TpHandleRepoIface *contact_repo; TpChannelTextSendError send_error; @@ -890,7 +890,7 @@ void rakia_text_channel_receive(RakiaTextChannel *chan, const char *text, gsize len) { - RakiaTextChannelPrivate *priv = TPSIP_TEXT_CHANNEL_GET_PRIVATE (chan); + RakiaTextChannelPrivate *priv = RAKIA_TEXT_CHANNEL_GET_PRIVATE (chan); TpMessage *msg; TpBaseConnection *base_conn; sip_call_id_t *hdr_call_id; diff --git a/rakia/text-channel.h b/rakia/text-channel.h index e74eb1c..4de8fa0 100644 --- a/rakia/text-channel.h +++ b/rakia/text-channel.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_TEXT_CHANNEL_H__ -#define __TPSIP_TEXT_CHANNEL_H__ +#ifndef __RAKIA_TEXT_CHANNEL_H__ +#define __RAKIA_TEXT_CHANNEL_H__ #include <glib-object.h> #include <telepathy-glib/dbus-properties-mixin.h> @@ -48,18 +48,18 @@ struct _RakiaTextChannel { GType rakia_text_channel_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_TEXT_CHANNEL \ +#define RAKIA_TYPE_TEXT_CHANNEL \ (rakia_text_channel_get_type()) -#define TPSIP_TEXT_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_TEXT_CHANNEL, RakiaTextChannel)) -#define TPSIP_TEXT_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_TEXT_CHANNEL, RakiaTextChannelClass)) -#define TPSIP_IS_TEXT_CHANNEL(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_TEXT_CHANNEL)) -#define TPSIP_IS_TEXT_CHANNEL_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_TEXT_CHANNEL)) -#define TPSIP_TEXT_CHANNEL_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_TEXT_CHANNEL, RakiaTextChannelClass)) +#define RAKIA_TEXT_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_TEXT_CHANNEL, RakiaTextChannel)) +#define RAKIA_TEXT_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_TEXT_CHANNEL, RakiaTextChannelClass)) +#define RAKIA_IS_TEXT_CHANNEL(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_TEXT_CHANNEL)) +#define RAKIA_IS_TEXT_CHANNEL_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_TEXT_CHANNEL)) +#define RAKIA_TEXT_CHANNEL_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_TEXT_CHANNEL, RakiaTextChannelClass)) void rakia_text_channel_receive (RakiaTextChannel *obj, const sip_t *sip, @@ -69,4 +69,4 @@ void rakia_text_channel_receive (RakiaTextChannel *obj, G_END_DECLS -#endif /* #ifndef __TPSIP_TEXT_CHANNEL_H__*/ +#endif /* #ifndef __RAKIA_TEXT_CHANNEL_H__*/ diff --git a/rakia/text-manager.c b/rakia/text-manager.c index 731694f..9d5b1b7 100644 --- a/rakia/text-manager.c +++ b/rakia/text-manager.c @@ -36,7 +36,7 @@ #include <sofia-sip/sip_tag.h> #include <sofia-sip/sip_status.h> -#define DEBUG_FLAG TPSIP_DEBUG_IM +#define DEBUG_FLAG RAKIA_DEBUG_IM #include "rakia/debug.h" @@ -69,12 +69,12 @@ struct _RakiaTextManagerPrivate gboolean dispose_has_run; }; -#define TPSIP_TEXT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_TEXT_MANAGER, RakiaTextManagerPrivate)) +#define RAKIA_TEXT_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_TEXT_MANAGER, RakiaTextManagerPrivate)) static void rakia_text_manager_init (RakiaTextManager *fac) { - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); priv->conn = NULL; priv->channels = g_hash_table_new_full (g_direct_hash, g_direct_equal, @@ -86,8 +86,8 @@ rakia_text_manager_init (RakiaTextManager *fac) static void rakia_text_manager_constructed (GObject *object) { - RakiaTextManager *fac = TPSIP_TEXT_MANAGER (object); - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManager *fac = RAKIA_TEXT_MANAGER (object); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); GObjectClass *parent_object_class = G_OBJECT_CLASS (rakia_text_manager_parent_class); @@ -101,8 +101,8 @@ rakia_text_manager_constructed (GObject *object) static void rakia_text_manager_dispose (GObject *object) { - RakiaTextManager *fac = TPSIP_TEXT_MANAGER (object); - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManager *fac = RAKIA_TEXT_MANAGER (object); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); if (priv->dispose_has_run) return; @@ -122,8 +122,8 @@ rakia_text_manager_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaTextManager *fac = TPSIP_TEXT_MANAGER (object); - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManager *fac = RAKIA_TEXT_MANAGER (object); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); switch (property_id) { case PROP_CONNECTION: @@ -141,8 +141,8 @@ rakia_text_manager_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaTextManager *fac = TPSIP_TEXT_MANAGER (object); - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManager *fac = RAKIA_TEXT_MANAGER (object); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); switch (property_id) { case PROP_CONNECTION: @@ -170,7 +170,7 @@ rakia_text_manager_class_init (RakiaTextManagerClass *klass) param_spec = g_param_spec_object ("connection", "RakiaBaseConnection object", "SIP connection that owns this text channel manager", - TPSIP_TYPE_BASE_CONNECTION, + RAKIA_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); } @@ -178,7 +178,7 @@ rakia_text_manager_class_init (RakiaTextManagerClass *klass) static void rakia_text_manager_close_all (RakiaTextManager *fac) { - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); GHashTable *channels; if (priv->status_changed_id != 0) @@ -217,8 +217,8 @@ rakia_text_manager_foreach_channel (TpChannelManager *manager, TpExportableChannelFunc func, gpointer user_data) { - RakiaTextManager *fac = TPSIP_TEXT_MANAGER (manager); - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManager *fac = RAKIA_TEXT_MANAGER (manager); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); struct _ForeachData data; data.func = func; @@ -236,8 +236,8 @@ rakia_text_manager_foreach_channel (TpChannelManager *manager, static void channel_closed (RakiaTextChannel *chan, gpointer user_data) { - RakiaTextManager *self = TPSIP_TEXT_MANAGER (user_data); - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (self); + RakiaTextManager *self = RAKIA_TEXT_MANAGER (user_data); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (self); TpHandle contact_handle; gboolean really_destroyed = TRUE; @@ -283,7 +283,7 @@ rakia_text_manager_new_channel (RakiaTextManager *fac, TpBaseConnection *conn; GSList *request_tokens; - priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); conn = priv->conn; object_path = g_strdup_printf ("%s/TextChannel%u", @@ -291,7 +291,7 @@ rakia_text_manager_new_channel (RakiaTextManager *fac, DEBUG ("object path %s", object_path); - chan = g_object_new (TPSIP_TYPE_TEXT_CHANNEL, + chan = g_object_new (RAKIA_TYPE_TEXT_CHANNEL, "connection", priv->conn, "object-path", object_path, "handle", handle, @@ -361,7 +361,7 @@ rakia_text_manager_requestotron (RakiaTextManager *self, GHashTable *request_properties, gboolean require_new) { - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (self); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (self); TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn; TpHandle handle; GError *error = NULL; @@ -419,7 +419,7 @@ rakia_text_manager_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { - RakiaTextManager *self = TPSIP_TEXT_MANAGER (manager); + RakiaTextManager *self = RAKIA_TEXT_MANAGER (manager); return rakia_text_manager_requestotron (self, request_token, request_properties, TRUE); @@ -431,7 +431,7 @@ rakia_text_manager_request_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { - RakiaTextManager *self = TPSIP_TEXT_MANAGER (manager); + RakiaTextManager *self = RAKIA_TEXT_MANAGER (manager); return rakia_text_manager_requestotron (self, request_token, request_properties, FALSE); @@ -443,7 +443,7 @@ rakia_text_manager_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { - RakiaTextManager *self = TPSIP_TEXT_MANAGER (manager); + RakiaTextManager *self = RAKIA_TEXT_MANAGER (manager); return rakia_text_manager_requestotron (self, request_token, request_properties, FALSE); @@ -453,7 +453,7 @@ static inline RakiaTextChannel * rakia_text_manager_lookup_channel (RakiaTextManager *fac, TpHandle handle) { - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (fac); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (fac); return g_hash_table_lookup (priv->channels, GUINT_TO_POINTER(handle)); @@ -601,7 +601,7 @@ connection_status_changed_cb (TpBaseConnection *conn, guint reason, RakiaTextManager *self) { - RakiaTextManagerPrivate *priv = TPSIP_TEXT_MANAGER_GET_PRIVATE (self); + RakiaTextManagerPrivate *priv = RAKIA_TEXT_MANAGER_GET_PRIVATE (self); switch (status) { diff --git a/rakia/text-manager.h b/rakia/text-manager.h index fc30edf..86d3daf 100644 --- a/rakia/text-manager.h +++ b/rakia/text-manager.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_TEXT_MANAGER_H__ -#define __TPSIP_TEXT_MANAGER_H__ +#ifndef __RAKIA_TEXT_MANAGER_H__ +#define __RAKIA_TEXT_MANAGER_H__ #include <glib-object.h> @@ -39,18 +39,18 @@ struct _RakiaTextManager { GType rakia_text_manager_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_TEXT_MANAGER \ +#define RAKIA_TYPE_TEXT_MANAGER \ (rakia_text_manager_get_type()) -#define TPSIP_TEXT_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_TEXT_MANAGER, RakiaTextManager)) -#define TPSIP_TEXT_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_TEXT_MANAGER, RakiaTextManagerClass)) -#define TPSIP_IS_TEXT_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_TEXT_MANAGER)) -#define TPSIP_IS_TEXT_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_TEXT_MANAGER)) -#define TPSIP_TEXT_MANAGER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_TEXT_MANAGER, RakiaTextManagerClass)) +#define RAKIA_TEXT_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_TEXT_MANAGER, RakiaTextManager)) +#define RAKIA_TEXT_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_TEXT_MANAGER, RakiaTextManagerClass)) +#define RAKIA_IS_TEXT_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_TEXT_MANAGER)) +#define RAKIA_IS_TEXT_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_TEXT_MANAGER)) +#define RAKIA_TEXT_MANAGER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_TEXT_MANAGER, RakiaTextManagerClass)) G_END_DECLS diff --git a/rakia/util.h b/rakia/util.h index c4baef4..81dc123 100644 --- a/rakia/util.h +++ b/rakia/util.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef TPSIP_UTIL_H_ -#define TPSIP_UTIL_H_ +#ifndef RAKIA_UTIL_H_ +#define RAKIA_UTIL_H_ #include <glib.h> @@ -35,4 +35,4 @@ gchar const *rakia_version_string (); G_END_DECLS -#endif /* !TPSIP_UTIL_H_ */ +#endif /* !RAKIA_UTIL_H_ */ diff --git a/src/protocol.c b/src/protocol.c index dfc9ff9..5cb902b 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -31,7 +31,7 @@ #include <rakia/text-manager.h> #include <sofia-sip/su_glib.h> -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" #include "sip-connection.h" #include "sip-connection-helpers.h" @@ -125,7 +125,7 @@ static TpCMParamSpec rakia_params[] = { /* STUN port */ { "stun-port", DBUS_TYPE_UINT16_AS_STRING, G_TYPE_UINT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, - GUINT_TO_POINTER(TPSIP_DEFAULT_STUN_PORT), PARAM_EASY, + GUINT_TO_POINTER(RAKIA_DEFAULT_STUN_PORT), PARAM_EASY, tp_cm_param_filter_uint_nonzero }, /* If the session content cannot be modified once initially set up */ @@ -158,7 +158,7 @@ static TpCMParamSpec rakia_params[] = { static void rakia_protocol_init (RakiaProtocol *self) { - self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TPSIP_TYPE_PROTOCOL, + self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, RAKIA_TYPE_PROTOCOL, RakiaProtocolPrivate); } @@ -172,18 +172,18 @@ static RakiaConnectionKeepaliveMechanism priv_parse_keepalive (const gchar *str) { if (str == NULL || strcmp (str, "auto") == 0) - return TPSIP_CONNECTION_KEEPALIVE_AUTO; + return RAKIA_CONNECTION_KEEPALIVE_AUTO; if (strcmp (str, "register") == 0) - return TPSIP_CONNECTION_KEEPALIVE_REGISTER; + return RAKIA_CONNECTION_KEEPALIVE_REGISTER; if (strcmp (str, "options") == 0) - return TPSIP_CONNECTION_KEEPALIVE_OPTIONS; + return RAKIA_CONNECTION_KEEPALIVE_OPTIONS; if (strcmp (str, "stun") == 0) - return TPSIP_CONNECTION_KEEPALIVE_STUN; + return RAKIA_CONNECTION_KEEPALIVE_STUN; if (strcmp (str, "off") == 0) - return TPSIP_CONNECTION_KEEPALIVE_NONE; + return RAKIA_CONNECTION_KEEPALIVE_NONE; WARNING ("unsupported keepalive-method value \"%s\", falling back to auto", str); - return TPSIP_CONNECTION_KEEPALIVE_AUTO; + return RAKIA_CONNECTION_KEEPALIVE_AUTO; } static gchar * @@ -273,7 +273,7 @@ new_connection (TpBaseProtocol *protocol, GHashTable *params, GError **error) { - RakiaProtocol *self = TPSIP_PROTOCOL (protocol); + RakiaProtocol *self = RAKIA_PROTOCOL (protocol); RakiaConnection *conn; guint i; const gchar *account; @@ -290,7 +290,7 @@ new_connection (TpBaseProtocol *protocol, transport = tp_asv_get_string (params, "transport"); port = tp_asv_get_uint32 (params, "port", NULL); - conn = g_object_new (TPSIP_TYPE_CONNECTION, + conn = g_object_new (RAKIA_TYPE_CONNECTION, "protocol", PROTOCOL_NAME, "sofia-root", self->priv->sofia_root, "address", account, @@ -438,8 +438,8 @@ get_connection_details (TpBaseProtocol *self, if (channel_managers != NULL) { GType types[] = { - TPSIP_TYPE_TEXT_MANAGER, - TPSIP_TYPE_MEDIA_MANAGER, + RAKIA_TYPE_TEXT_MANAGER, + RAKIA_TYPE_MEDIA_MANAGER, G_TYPE_INVALID }; *channel_managers = g_memdup (types, sizeof(types)); @@ -478,7 +478,7 @@ rakia_protocol_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - RakiaProtocol *self = TPSIP_PROTOCOL (object); + RakiaProtocol *self = RAKIA_PROTOCOL (object); switch (property_id) { @@ -498,7 +498,7 @@ rakia_protocol_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - RakiaProtocol *self = TPSIP_PROTOCOL (object); + RakiaProtocol *self = RAKIA_PROTOCOL (object); switch (property_id) { @@ -542,7 +542,7 @@ rakia_protocol_class_init (RakiaProtocolClass *klass) TpBaseProtocol * rakia_protocol_new (su_root_t *sofia_root) { - return g_object_new (TPSIP_TYPE_PROTOCOL, + return g_object_new (RAKIA_TYPE_PROTOCOL, "name", PROTOCOL_NAME, "sofia-root", sofia_root, NULL); diff --git a/src/protocol.h b/src/protocol.h index c7506ba..a7e9b25 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -17,8 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef TPSIP_PROTOCOL_H -#define TPSIP_PROTOCOL_H +#ifndef RAKIA_PROTOCOL_H +#define RAKIA_PROTOCOL_H #include <glib-object.h> #include <telepathy-glib/base-protocol.h> @@ -47,22 +47,22 @@ struct _RakiaProtocol { GType rakia_protocol_get_type (void); -#define TPSIP_TYPE_PROTOCOL \ +#define RAKIA_TYPE_PROTOCOL \ (rakia_protocol_get_type ()) -#define TPSIP_PROTOCOL(obj) \ +#define RAKIA_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ - TPSIP_TYPE_PROTOCOL, \ + RAKIA_TYPE_PROTOCOL, \ RakiaProtocol)) -#define TPSIP_PROTOCOL_CLASS(klass) \ +#define RAKIA_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ - TPSIP_TYPE_PROTOCOL, \ + RAKIA_TYPE_PROTOCOL, \ RakiaProtocolClass)) -#define TPSIP_IS_PROTOCOL_CLASS(klass) \ +#define RAKIA_IS_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - TPSIP_TYPE_PROTOCOL)) -#define TPSIP_PROTOCOL_GET_CLASS(klass) \ + RAKIA_TYPE_PROTOCOL)) +#define RAKIA_PROTOCOL_GET_CLASS(klass) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ - TPSIP_TYPE_PROTOCOL, \ + RAKIA_TYPE_PROTOCOL, \ RakiaProtocolClass)) gchar *rakia_protocol_normalize_contact (const gchar *id, diff --git a/src/sip-connection-helpers.c b/src/sip-connection-helpers.c index 592b540..080aa5f 100644 --- a/src/sip-connection-helpers.c +++ b/src/sip-connection-helpers.c @@ -41,21 +41,21 @@ #include "sip-connection-private.h" -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" /* Default keepalive timeout in seconds, * a value obtained from Sofia-SIP documentation */ -#define TPSIP_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL 120 +#define RAKIA_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL 120 /* The user is not allowed to set keepalive timeout to lower than that, * to avoid wasting traffic and device power */ -#define TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL 30 +#define RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL 30 /* The user is not allowed to set keepalive timeout to lower than that * for REGISTER keepalives, to avoid wasting traffic and device power. * REGISTER is special because it may tie resources on the server side */ -#define TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER 50 +#define RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER 50 static sip_to_t * priv_sip_to_url_make (RakiaConnection *conn, @@ -72,7 +72,7 @@ static sip_from_t * priv_sip_from_url_make (RakiaConnection *conn, su_home_t *home) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); sip_from_t *from; gchar *alias = NULL; @@ -106,7 +106,7 @@ nua_handle_t * rakia_conn_create_register_handle (RakiaConnection *conn, TpHandle contact) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); nua_handle_t *result = NULL; su_home_t temphome[1] = { SU_HOME_INIT(temphome) }; sip_to_t *to; @@ -128,7 +128,7 @@ nua_handle_t * rakia_conn_create_request_handle (RakiaConnection *conn, TpHandle contact) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); nua_handle_t *result = NULL; su_home_t temphome[1] = { SU_HOME_INIT(temphome) }; sip_from_t *from; @@ -155,7 +155,7 @@ rakia_conn_create_request_handle (RakiaConnection *conn, void rakia_conn_update_proxy_and_transport (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); if (priv->proxy_url != NULL) { @@ -197,7 +197,7 @@ rakia_conn_update_proxy_and_transport (RakiaConnection *conn) const url_t * rakia_conn_get_local_url (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); url_t *url; url = url_make (priv->sofia_home, "sip:*:*"); @@ -340,7 +340,7 @@ priv_nua_set_outbound_options (nua_t* nua, GHashTable* option_table) void rakia_conn_update_nua_outbound (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); GHashTable *option_table; g_return_if_fail (priv->sofia_nua != NULL); @@ -353,22 +353,22 @@ rakia_conn_update_nua_outbound (RakiaConnection *conn) /* Set options that affect keepalive behavior */ switch (priv->keepalive_mechanism) { - case TPSIP_CONNECTION_KEEPALIVE_NONE: - case TPSIP_CONNECTION_KEEPALIVE_REGISTER: + case RAKIA_CONNECTION_KEEPALIVE_NONE: + case RAKIA_CONNECTION_KEEPALIVE_REGISTER: /* For REGISTER keepalives, we use NUTAG_M_FEATURES */ g_hash_table_insert (option_table, g_strdup ("options-keepalive"), GINT_TO_POINTER(FALSE)); break; - case TPSIP_CONNECTION_KEEPALIVE_OPTIONS: + case RAKIA_CONNECTION_KEEPALIVE_OPTIONS: g_hash_table_insert (option_table, g_strdup ("options-keepalive"), GINT_TO_POINTER(TRUE)); break; - case TPSIP_CONNECTION_KEEPALIVE_STUN: + case RAKIA_CONNECTION_KEEPALIVE_STUN: /* Not supported */ break; - case TPSIP_CONNECTION_KEEPALIVE_AUTO: + case RAKIA_CONNECTION_KEEPALIVE_AUTO: default: break; } @@ -394,9 +394,9 @@ priv_sanitize_keepalive_interval (RakiaConnectionPrivate *priv) if (priv->keepalive_interval != 0) { minimum_interval = - (priv->keepalive_mechanism == TPSIP_CONNECTION_KEEPALIVE_REGISTER) - ? TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER - : TPSIP_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL; + (priv->keepalive_mechanism == RAKIA_CONNECTION_KEEPALIVE_REGISTER) + ? RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL_REGISTER + : RAKIA_CONNECTION_MINIMUM_KEEPALIVE_INTERVAL; if (priv->keepalive_interval < minimum_interval) { WARNING ("keepalive interval is too low, pushing to %u", minimum_interval); @@ -408,13 +408,13 @@ priv_sanitize_keepalive_interval (RakiaConnectionPrivate *priv) void rakia_conn_update_nua_keepalive_interval (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); long keepalive_interval; if (!priv->keepalive_interval_specified) return; - if (priv->keepalive_mechanism == TPSIP_CONNECTION_KEEPALIVE_NONE) + if (priv->keepalive_mechanism == RAKIA_CONNECTION_KEEPALIVE_NONE) keepalive_interval = 0; else { @@ -434,11 +434,11 @@ rakia_conn_update_nua_keepalive_interval (RakiaConnection *conn) void rakia_conn_update_nua_contact_features (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); char *contact_features; guint timeout; - if (priv->keepalive_mechanism != TPSIP_CONNECTION_KEEPALIVE_REGISTER) + if (priv->keepalive_mechanism != RAKIA_CONNECTION_KEEPALIVE_REGISTER) return; if (priv->keepalive_interval == 0) @@ -447,7 +447,7 @@ rakia_conn_update_nua_contact_features (RakiaConnection *conn) priv_sanitize_keepalive_interval (priv); timeout = priv->keepalive_interval_specified ? priv->keepalive_interval - : TPSIP_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL; + : RAKIA_CONNECTION_DEFAULT_KEEPALIVE_INTERVAL; contact_features = g_strdup_printf ("expires=%u", timeout); nua_set_params(priv->sofia_nua, NUTAG_M_FEATURES(contact_features), @@ -458,7 +458,7 @@ rakia_conn_update_nua_contact_features (RakiaConnection *conn) static void rakia_conn_set_stun_server_address (RakiaConnection *conn, const gchar *address) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); g_return_if_fail (priv->media_manager != NULL); g_object_set (priv->media_manager, "stun-server", address, @@ -469,8 +469,8 @@ rakia_conn_set_stun_server_address (RakiaConnection *conn, const gchar *address) static void priv_stun_resolver_cb (sres_context_t *ctx, sres_query_t *query, sres_record_t **answers) { - RakiaConnection *conn = TPSIP_CONNECTION (ctx); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnection *conn = RAKIA_CONNECTION (ctx); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); sres_a_record_t *ans = NULL; if (NULL != answers) @@ -507,7 +507,7 @@ priv_stun_resolver_cb (sres_context_t *ctx, sres_query_t *query, sres_record_t * void rakia_conn_resolv_stun_server (RakiaConnection *conn, const gchar *stun_host) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); struct in_addr test_addr; if (stun_host == NULL) @@ -548,8 +548,8 @@ priv_stun_discover_cb (sres_context_t *ctx, sres_query_t *query, sres_record_t **answers) { - RakiaConnection *conn = TPSIP_CONNECTION (ctx); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnection *conn = RAKIA_CONNECTION (ctx); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); sres_srv_record_t *sel = NULL; int n_sel_items = 0; int i; @@ -643,7 +643,7 @@ priv_stun_discover_cb (sres_context_t *ctx, void rakia_conn_discover_stun_server (RakiaConnection *conn) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); const char *url_host; char *srv_domain; struct in_addr test_addr; @@ -694,8 +694,8 @@ rakia_handle_normalize (TpHandleRepoIface *repo, gpointer context, GError **error) { - RakiaConnection *conn = TPSIP_CONNECTION (context); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + RakiaConnection *conn = RAKIA_CONNECTION (context); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn); return rakia_normalize_contact (sipuri, priv->account_url, priv->transport, error); @@ -757,7 +757,7 @@ heartbeat_wakeup (su_root_magic_t *foo, void *user_data) { RakiaConnection *self = (RakiaConnection *) user_data; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); DEBUG("tick"); @@ -781,7 +781,7 @@ void rakia_conn_heartbeat_init (RakiaConnection *self) { #ifdef HAVE_LIBIPHB - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); int wait_id; int reference_interval = 0; su_root_t *root = NULL; @@ -822,7 +822,7 @@ void rakia_conn_heartbeat_shutdown (RakiaConnection *self) { #ifdef HAVE_LIBIPHB - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); su_root_t *root = NULL; if (priv->heartbeat_wait_id == 0) diff --git a/src/sip-connection-helpers.h b/src/sip-connection-helpers.h index 29ed642..49f2f98 100644 --- a/src/sip-connection-helpers.h +++ b/src/sip-connection-helpers.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_HELPERS_H__ -#define __TPSIP_CONNECTION_HELPERS_H__ +#ifndef __RAKIA_CONNECTION_HELPERS_H__ +#define __RAKIA_CONNECTION_HELPERS_H__ #include <glib.h> @@ -59,4 +59,4 @@ void rakia_conn_heartbeat_shutdown (RakiaConnection *self); G_END_DECLS -#endif /* #ifndef __TPSIP_CONNECTION_HELPERS_H__*/ +#endif /* #ifndef __RAKIA_CONNECTION_HELPERS_H__*/ diff --git a/src/sip-connection-manager.c b/src/sip-connection-manager.c index e64cf56..2fd8efe 100644 --- a/src/sip-connection-manager.c +++ b/src/sip-connection-manager.c @@ -42,7 +42,7 @@ #include "sip-connection-manager.h" #include "sip-connection.h" -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" @@ -55,13 +55,13 @@ struct _RakiaConnectionManagerPrivate TpDebugSender *debug_sender; }; -#define TPSIP_CONNECTION_MANAGER_GET_PRIVATE(obj) ((obj)->priv) +#define RAKIA_CONNECTION_MANAGER_GET_PRIVATE(obj) ((obj)->priv) static void rakia_connection_manager_init (RakiaConnectionManager *obj) { RakiaConnectionManagerPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (obj, - TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerPrivate); + RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerPrivate); GSource *source; obj->priv = priv; @@ -75,14 +75,14 @@ rakia_connection_manager_init (RakiaConnectionManager *obj) g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN); #ifdef HAVE_LIBIPHB - su_root_set_max_defer (priv->sofia_root, TPSIP_DEFER_TIMEOUT * 1000L); + su_root_set_max_defer (priv->sofia_root, RAKIA_DEFER_TIMEOUT * 1000L); #endif } static void rakia_connection_manager_constructed (GObject *object) { - RakiaConnectionManager *self = TPSIP_CONNECTION_MANAGER (object); + RakiaConnectionManager *self = RAKIA_CONNECTION_MANAGER (object); TpBaseConnectionManager *base = (TpBaseConnectionManager *) self; void (*constructed) (GObject *) = ((GObjectClass *) rakia_connection_manager_parent_class)->constructed; @@ -116,8 +116,8 @@ rakia_connection_manager_class_init (RakiaConnectionManagerClass *klass) void rakia_connection_manager_finalize (GObject *object) { - RakiaConnectionManager *self = TPSIP_CONNECTION_MANAGER (object); - RakiaConnectionManagerPrivate *priv = TPSIP_CONNECTION_MANAGER_GET_PRIVATE (self); + RakiaConnectionManager *self = RAKIA_CONNECTION_MANAGER (object); + RakiaConnectionManagerPrivate *priv = RAKIA_CONNECTION_MANAGER_GET_PRIVATE (self); GSource *source; source = su_glib_root_gsource(priv->sofia_root); diff --git a/src/sip-connection-manager.h b/src/sip-connection-manager.h index 1def40a..ed89900 100644 --- a/src/sip-connection-manager.h +++ b/src/sip-connection-manager.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_MANAGER_H__ -#define __TPSIP_CONNECTION_MANAGER_H__ +#ifndef __RAKIA_CONNECTION_MANAGER_H__ +#define __RAKIA_CONNECTION_MANAGER_H__ #include <glib-object.h> @@ -43,21 +43,21 @@ struct _RakiaConnectionManager { GType rakia_connection_manager_get_type(void); /* TYPE MACROS */ -#define TPSIP_TYPE_CONNECTION_MANAGER \ +#define RAKIA_TYPE_CONNECTION_MANAGER \ (rakia_connection_manager_get_type()) -#define TPSIP_CONNECTION_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManager)) -#define TPSIP_CONNECTION_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) -#define TPSIP_IS_CONNECTION_MANAGER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_CONNECTION_MANAGER)) -#define TPSIP_IS_CONNECTION_MANAGER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_CONNECTION_MANAGER)) -#define TPSIP_CONNECTION_MANAGER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) +#define RAKIA_CONNECTION_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManager)) +#define RAKIA_CONNECTION_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) +#define RAKIA_IS_CONNECTION_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_CONNECTION_MANAGER)) +#define RAKIA_IS_CONNECTION_MANAGER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_CONNECTION_MANAGER)) +#define RAKIA_CONNECTION_MANAGER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_CONNECTION_MANAGER, RakiaConnectionManagerClass)) extern const TpCMProtocolSpec rakia_protocols[]; G_END_DECLS -#endif /* #ifndef __TPSIP_CONNECTION_MANAGER_H__*/ +#endif /* #ifndef __RAKIA_CONNECTION_MANAGER_H__*/ diff --git a/src/sip-connection-private.h b/src/sip-connection-private.h index 4d25d51..9a572aa 100644 --- a/src/sip-connection-private.h +++ b/src/sip-connection-private.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_PRIVATE_H__ -#define __TPSIP_CONNECTION_PRIVATE_H__ +#ifndef __RAKIA_CONNECTION_PRIVATE_H__ +#define __RAKIA_CONNECTION_PRIVATE_H__ #include "config.h" @@ -78,8 +78,8 @@ struct _RakiaConnectionPrivate gboolean dispose_has_run; }; -/* #define TPSIP_PROTOCOL_STRING "sip" */ +/* #define RAKIA_PROTOCOL_STRING "sip" */ -#define TPSIP_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPSIP_TYPE_CONNECTION, RakiaConnectionPrivate)) +#define RAKIA_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RAKIA_TYPE_CONNECTION, RakiaConnectionPrivate)) -#endif /*__TPSIP_CONNECTION_PRIVATE_H__*/ +#endif /*__RAKIA_CONNECTION_PRIVATE_H__*/ diff --git a/src/sip-connection.c b/src/sip-connection.c index 84aa2d7..c611512 100644 --- a/src/sip-connection.c +++ b/src/sip-connection.c @@ -50,16 +50,16 @@ #include <sofia-sip/msg_header.h> #include <sofia-sip/tport_tag.h> -#define DEBUG_FLAG TPSIP_DEBUG_CONNECTION +#define DEBUG_FLAG RAKIA_DEBUG_CONNECTION #include "rakia/debug.h" G_DEFINE_TYPE_WITH_CODE (RakiaConnection, rakia_connection, - TPSIP_TYPE_BASE_CONNECTION, + RAKIA_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, rakia_connection_aliasing_svc_iface_init); - G_IMPLEMENT_INTERFACE (TPSIP_TYPE_CONNECTION_ALIASING, NULL); + G_IMPLEMENT_INTERFACE (RAKIA_TYPE_CONNECTION_ALIASING, NULL); ); @@ -134,15 +134,15 @@ rakia_create_handle_repos (TpBaseConnection *conn, static GPtrArray * rakia_connection_create_channel_managers (TpBaseConnection *conn) { - RakiaConnection *self = TPSIP_CONNECTION (conn); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnection *self = RAKIA_CONNECTION (conn); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); GPtrArray *channel_managers = g_ptr_array_sized_new (2); g_ptr_array_add (channel_managers, - g_object_new (TPSIP_TYPE_TEXT_MANAGER, + g_object_new (RAKIA_TYPE_TEXT_MANAGER, "connection", self, NULL)); - priv->media_manager = g_object_new (TPSIP_TYPE_MEDIA_MANAGER, + priv->media_manager = g_object_new (RAKIA_TYPE_MEDIA_MANAGER, "connection", self, NULL); g_ptr_array_add (channel_managers, priv->media_manager); @@ -156,7 +156,7 @@ rakia_connection_create_channel_managers (TpBaseConnection *conn) static void rakia_connection_init (RakiaConnection *self) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); priv->sofia_home = su_home_new(sizeof (su_home_t)); @@ -170,7 +170,7 @@ rakia_connection_set_property (GObject *object, GParamSpec *pspec) { RakiaConnection *self = (RakiaConnection*) object; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); switch (property_id) { case PROP_ADDRESS: { @@ -218,8 +218,8 @@ rakia_connection_set_property (GObject *object, RakiaConnectionKeepaliveMechanism mech = g_value_get_enum (value); if (priv->keepalive_interval_specified && priv->keepalive_interval == 0) { - if (mech != TPSIP_CONNECTION_KEEPALIVE_NONE - && mech != TPSIP_CONNECTION_KEEPALIVE_AUTO) + if (mech != RAKIA_CONNECTION_KEEPALIVE_NONE + && mech != RAKIA_CONNECTION_KEEPALIVE_AUTO) WARNING ("keep-alive mechanism selection is ignored when interval is 0"); } else @@ -238,7 +238,7 @@ rakia_connection_set_property (GObject *object, priv->keepalive_interval_specified = TRUE; if (priv->keepalive_interval == 0) { - priv->keepalive_mechanism = TPSIP_CONNECTION_KEEPALIVE_NONE; + priv->keepalive_mechanism = RAKIA_CONNECTION_KEEPALIVE_NONE; if (priv->sofia_nua != NULL) rakia_conn_update_nua_outbound (self); } @@ -305,7 +305,7 @@ rakia_connection_get_property (GObject *object, GParamSpec *pspec) { RakiaConnection *self = (RakiaConnection *) object; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); switch (property_id) { case PROP_ADDRESS: { @@ -396,11 +396,11 @@ static void rakia_connection_finalize (GObject *object); static gchar * rakia_connection_unique_name (TpBaseConnection *base) { - RakiaConnection *conn = TPSIP_CONNECTION (base); + RakiaConnection *conn = RAKIA_CONNECTION (base); RakiaConnectionPrivate *priv; - g_assert (TPSIP_IS_CONNECTION (conn)); - priv = TPSIP_CONNECTION_GET_PRIVATE (conn); + g_assert (RAKIA_IS_CONNECTION (conn)); + priv = RAKIA_CONNECTION_GET_PRIVATE (conn); return g_strdup (priv->address); } @@ -432,7 +432,7 @@ rakia_connection_class_init (RakiaConnectionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseConnectionClass *base_class = TP_BASE_CONNECTION_CLASS (klass); - RakiaBaseConnectionClass *sip_class = TPSIP_BASE_CONNECTION_CLASS (klass); + RakiaBaseConnectionClass *sip_class = RAKIA_BASE_CONNECTION_CLASS (klass); GParamSpec *param_spec; /* Implement pure-virtual methods */ @@ -510,7 +510,7 @@ rakia_connection_class_init (RakiaConnectionClass *klass) param_spec = g_param_spec_enum ("keepalive-mechanism", "Keepalive mechanism", "Keepalive mechanism for SIP registration", rakia_connection_keepalive_mechanism_get_type (), - TPSIP_CONNECTION_KEEPALIVE_AUTO, /*default value*/ + RAKIA_CONNECTION_KEEPALIVE_AUTO, /*default value*/ G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); INST_PROP(PROP_KEEPALIVE_MECHANISM); @@ -543,7 +543,7 @@ rakia_connection_class_init (RakiaConnectionClass *klass) param_spec = g_param_spec_uint ("stun-port", "STUN port", "STUN server port", 0, G_MAXUINT16, - TPSIP_DEFAULT_STUN_PORT, /*default value*/ + RAKIA_DEFAULT_STUN_PORT, /*default value*/ G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); INST_PROP(PROP_STUN_PORT); @@ -646,7 +646,7 @@ priv_handle_auth (RakiaConnection* self, const sip_t *sip, gboolean home_realm) { - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); sip_www_authenticate_t const *wa; sip_proxy_authenticate_t const *pa; const char *method = NULL; @@ -783,7 +783,7 @@ priv_password_manager_prompt_cb (GObject *source_object, else { RakiaConnectionPrivate *priv = - TPSIP_CONNECTION_GET_PRIVATE (data->self); + RAKIA_CONNECTION_GET_PRIVATE (data->self); password = password_string->str; /* also save it for later. */ @@ -856,7 +856,7 @@ rakia_connection_add_auth_handler (RakiaBaseConnection *self, static nua_handle_t * rakia_connection_create_nua_handle (RakiaBaseConnection *base, TpHandle handle) { - return rakia_conn_create_request_handle (TPSIP_CONNECTION (base), handle); + return rakia_conn_create_request_handle (RAKIA_CONNECTION (base), handle); } static gboolean @@ -913,12 +913,12 @@ rakia_connection_nua_r_register_cb (RakiaConnection *self, static void rakia_connection_shut_down (TpBaseConnection *base) { - RakiaConnection *self = TPSIP_CONNECTION (base); + RakiaConnection *self = RAKIA_CONNECTION (base); RakiaConnectionPrivate *priv; DEBUG ("enter"); - priv = TPSIP_CONNECTION_GET_PRIVATE (self); + priv = RAKIA_CONNECTION_GET_PRIVATE (self); /* We disposed of the REGISTER handle in the disconnected method */ g_assert (priv->register_op == NULL); @@ -936,9 +936,9 @@ rakia_connection_shut_down (TpBaseConnection *base) void rakia_connection_dispose (GObject *object) { - RakiaConnection *self = TPSIP_CONNECTION (object); + RakiaConnection *self = RAKIA_CONNECTION (object); TpBaseConnection *base = (TpBaseConnection *)self; - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); if (priv->dispose_has_run) return; @@ -965,8 +965,8 @@ rakia_connection_dispose (GObject *object) void rakia_connection_finalize (GObject *obj) { - RakiaConnection *self = TPSIP_CONNECTION (obj); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnection *self = RAKIA_CONNECTION (obj); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); /* free any data held directly by the object here */ @@ -1002,8 +1002,8 @@ static gboolean rakia_connection_start_connecting (TpBaseConnection *base, GError **error) { - RakiaConnection *self = TPSIP_CONNECTION (base); - RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (self); + RakiaConnection *self = RAKIA_CONNECTION (base); + RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (self); TpHandleRepoIface *contact_repo; const gchar *sip_address; const url_t *local_url; @@ -1041,7 +1041,7 @@ rakia_connection_start_connecting (TpBaseConnection *base, /* step: create stack instance */ priv->sofia_nua = nua_create (root, rakia_base_connection_sofia_callback, - TPSIP_BASE_CONNECTION (self), + RAKIA_BASE_CONNECTION (self), SOATAG_AF(SOA_AF_IP4_IP6), SIPTAG_FROM_STR(sip_address), NUTAG_URL(local_url), @@ -1112,10 +1112,10 @@ rakia_connection_start_connecting (TpBaseConnection *base, static void rakia_connection_disconnected (TpBaseConnection *base) { - RakiaConnection *obj = TPSIP_CONNECTION (base); + RakiaConnection *obj = RAKIA_CONNECTION (base); RakiaConnectionPrivate *priv; - priv = TPSIP_CONNECTION_GET_PRIVATE (obj); + priv = RAKIA_CONNECTION_GET_PRIVATE (obj); DEBUG("enter"); diff --git a/src/sip-connection.h b/src/sip-connection.h index 5e79773..8f26bd5 100644 --- a/src/sip-connection.h +++ b/src/sip-connection.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __TPSIP_CONNECTION_H__ -#define __TPSIP_CONNECTION_H__ +#ifndef __RAKIA_CONNECTION_H__ +#define __RAKIA_CONNECTION_H__ #include <glib-object.h> @@ -30,11 +30,11 @@ G_BEGIN_DECLS typedef enum { - TPSIP_CONNECTION_KEEPALIVE_AUTO = 0, /** Keepalive management is up to the implementation */ - TPSIP_CONNECTION_KEEPALIVE_NONE, /** Disable keepalive management */ - TPSIP_CONNECTION_KEEPALIVE_REGISTER, /** Maintain registration with REGISTER requests */ - TPSIP_CONNECTION_KEEPALIVE_OPTIONS, /** Maintain registration with OPTIONS requests */ - TPSIP_CONNECTION_KEEPALIVE_STUN, /** Maintain registration with STUN as described in IETF draft-sip-outbound */ + RAKIA_CONNECTION_KEEPALIVE_AUTO = 0, /** Keepalive management is up to the implementation */ + RAKIA_CONNECTION_KEEPALIVE_NONE, /** Disable keepalive management */ + RAKIA_CONNECTION_KEEPALIVE_REGISTER, /** Maintain registration with REGISTER requests */ + RAKIA_CONNECTION_KEEPALIVE_OPTIONS, /** Maintain registration with OPTIONS requests */ + RAKIA_CONNECTION_KEEPALIVE_STUN, /** Maintain registration with STUN as described in IETF draft-sip-outbound */ } RakiaConnectionKeepaliveMechanism; typedef struct _RakiaConnection RakiaConnection; @@ -51,18 +51,18 @@ struct _RakiaConnection { }; /* TYPE MACROS */ -#define TPSIP_TYPE_CONNECTION \ +#define RAKIA_TYPE_CONNECTION \ (rakia_connection_get_type()) -#define TPSIP_CONNECTION(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), TPSIP_TYPE_CONNECTION, RakiaConnection)) -#define TPSIP_CONNECTION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), TPSIP_TYPE_CONNECTION, RakiaConnectionClass)) -#define TPSIP_IS_CONNECTION(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), TPSIP_TYPE_CONNECTION)) -#define TPSIP_IS_CONNECTION_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), TPSIP_TYPE_CONNECTION)) -#define TPSIP_CONNECTION_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), TPSIP_TYPE_CONNECTION, RakiaConnectionClass)) +#define RAKIA_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), RAKIA_TYPE_CONNECTION, RakiaConnection)) +#define RAKIA_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), RAKIA_TYPE_CONNECTION, RakiaConnectionClass)) +#define RAKIA_IS_CONNECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), RAKIA_TYPE_CONNECTION)) +#define RAKIA_IS_CONNECTION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), RAKIA_TYPE_CONNECTION)) +#define RAKIA_CONNECTION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), RAKIA_TYPE_CONNECTION, RakiaConnectionClass)) GType rakia_connection_get_type (void) G_GNUC_CONST; @@ -73,4 +73,4 @@ const gchar **rakia_connection_get_implemented_interfaces (void); G_END_DECLS -#endif /* #ifndef __TPSIP_CONNECTION_H__*/ +#endif /* #ifndef __RAKIA_CONNECTION_H__*/ diff --git a/src/telepathy-rakia.c b/src/telepathy-rakia.c index 76dffe7..7012a23 100644 --- a/src/telepathy-rakia.c +++ b/src/telepathy-rakia.c @@ -36,7 +36,7 @@ static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *)g_object_new ( - TPSIP_TYPE_CONNECTION_MANAGER, NULL); + RAKIA_TYPE_CONNECTION_MANAGER, NULL); } @@ -55,12 +55,12 @@ main (int argc, char** argv) rakia_debug_set_flags_from_env (); #endif - if (g_getenv ("TPSIP_PERSIST") || g_getenv ("RAKIA_PERSIST")) + if (g_getenv ("RAKIA_PERSIST") || g_getenv ("RAKIA_PERSIST")) { tp_debug_set_persistent (TRUE); } - tp_debug_divert_messages (g_getenv ("TPSIP_LOGFILE")); + tp_debug_divert_messages (g_getenv ("RAKIA_LOGFILE")); logdata = rakia_sofia_log_init (); diff --git a/tests/twisted/tools/exec-with-log.sh.in b/tests/twisted/tools/exec-with-log.sh.in index 1eb6c7d..c3baef1 100644 --- a/tests/twisted/tools/exec-with-log.sh.in +++ b/tests/twisted/tools/exec-with-log.sh.in @@ -2,7 +2,7 @@ cd "@abs_top_builddir@/tests/twisted/tools" -export TPSIP_DEBUG=all +export RAKIA_DEBUG=all export TPORT_LOG=1 ulimit -c unlimited exec > rakia-testing.log 2>&1 |