static void
_offer_with_address (TpStreamTubeChannel *self,
    GHashTable *params)
{
  GValue *addressv = NULL;
  GError *error = NULL;

  addressv = tp_address_variant_from_g_socket_address (self->priv->address,
      &self->priv->socket_type, &error);
  if (error != NULL)
    {
      operation_failed (self, error);

      g_clear_error (&error);
      goto finally;
    }

  /* Connect the NewRemoteConnection signal */
  tp_cli_channel_type_stream_tube_connect_to_new_remote_connection (
      TP_CHANNEL (self), _new_remote_connection,
      NULL, NULL, G_OBJECT (self), &error);
  if (error != NULL)
    {
      operation_failed (self, error);

      g_clear_error (&error);
      goto finally;
    }

  g_assert (self->priv->parameters == NULL);
  if (params != NULL)
    self->priv->parameters = g_hash_table_ref (params);
  else
    self->priv->parameters = tp_asv_new (NULL, NULL);

  g_object_notify (G_OBJECT (self), "parameters");
  g_object_notify (G_OBJECT (self), "parameters-vardict");

  /* Call Offer */
  tp_cli_channel_type_stream_tube_call_offer (TP_CHANNEL (self), -1,
      self->priv->socket_type, addressv, self->priv->access_control,
      self->priv->parameters, _channel_offered, NULL, NULL, G_OBJECT (self));

finally:
  if (addressv != NULL)
    tp_g_value_slice_free (addressv);
}
NS_IMETHODIMP
csTpChannelTypeStreamTube::ConnectToNewRemoteConnection(csITpChannelTypeStreamTubeNewRemoteConnectionObserver *observer)
{
    if (!m_Proxy)
        return NS_ERROR_NOT_INITIALIZED;

    NS_ENSURE_ARG_POINTER(observer);

    if (!m_NewRemoteConnectionObservers) {
        m_NewRemoteConnectionObservers = do_CreateInstance(NS_ARRAY_CONTRACTID);
        tp_cli_channel_type_stream_tube_connect_to_new_remote_connection(m_Proxy,
                NewRemoteConnectionSignalCallback, this, NULL, NULL, NULL);
    }

    m_NewRemoteConnectionObservers->AppendElement(observer, PR_FALSE);
    return NS_OK;
}