WockyJingleSession

## WockyJingleSession WockyJingleSession |

## Synopsis

    struct              WockyJingleSessionClass;
    WockyJingleSession * wocky_jingle_session_new           (WockyJingleFactory *factory,
                                                             WockyPorter *porter,
                                                             const gchar *session_id,
                                                             gboolean local_initiator,
                                                             WockyContact *peer,
                                                             WockyJingleDialect dialect,
                                                             gboolean local_hold);
    const gchar *       wocky_jingle_session_detect         (WockyStanza *stanza,
                                                             WockyJingleAction *action,
                                                             WockyJingleDialect *dialect);
    gboolean            wocky_jingle_session_parse          (WockyJingleSession *sess,
                                                             WockyJingleAction action,
                                                             WockyStanza *stanza,
                                                             GError **error);
    WockyStanza *       wocky_jingle_session_new_message    (WockyJingleSession *sess,
                                                             WockyJingleAction action,
                                                             WockyNode **sess_node);
    void                wocky_jingle_session_accept         (WockyJingleSession *sess);
    gboolean            wocky_jingle_session_terminate      (WockyJingleSession *sess,
                                                             WockyJingleReason reason,
                                                             const gchar *text,
                                                             GError **error);
    void                wocky_jingle_session_remove_content (WockyJingleSession *sess,
                                                             WockyJingleContent *c);
    WockyJingleContent * wocky_jingle_session_add_content   (WockyJingleSession *sess,
                                                             WockyJingleMediaType mtype,
                                                             WockyJingleContentSenders senders,
                                                             const char *name,
                                                             const gchar *content_ns,
                                                             const gchar *transport_ns);
    GType               wocky_jingle_session_get_content_type
                                                            (WockyJingleSession *Param1);
    GList *             wocky_jingle_session_get_contents   (WockyJingleSession *sess);
    const gchar *       wocky_jingle_session_get_peer_resource
                                                            (WockyJingleSession *sess);
    const gchar *       wocky_jingle_session_get_initiator  (WockyJingleSession *sess);
    const gchar *       wocky_jingle_session_get_sid        (WockyJingleSession *sess);
    WockyJingleDialect  wocky_jingle_session_get_dialect    (WockyJingleSession *sess);
    gboolean            wocky_jingle_session_can_modify_contents
                                                            (WockyJingleSession *sess);
    gboolean            wocky_jingle_session_peer_has_cap   (WockyJingleSession *self,
                                                             const gchar *cap_or_quirk);
    void                wocky_jingle_session_send           (WockyJingleSession *sess,
                                                             WockyStanza *stanza);
    void                wocky_jingle_session_set_local_hold (WockyJingleSession *sess,
                                                             gboolean held);
    gboolean            wocky_jingle_session_get_remote_hold
                                                            (WockyJingleSession *sess);
    gboolean            wocky_jingle_session_get_remote_ringing
                                                            (WockyJingleSession *sess);
    gboolean            wocky_jingle_session_defines_action (WockyJingleSession *sess,
                                                             WockyJingleAction action);
    WockyContact *      wocky_jingle_session_get_peer_contact
                                                            (WockyJingleSession *self);
    const gchar *       wocky_jingle_session_get_peer_jid   (WockyJingleSession *sess);
    const gchar *       wocky_jingle_session_get_reason_name
                                                            (WockyJingleReason reason);
    WockyJingleFactory * wocky_jingle_session_get_factory   (WockyJingleSession *self);
    WockyPorter *       wocky_jingle_session_get_porter     (WockyJingleSession *self);
    void                wocky_jingle_session_acknowledge_iq (WockyJingleSession *self,
                                                             WockyStanza *stanza);

## Description

## Details

### struct WockyJingleSessionClass

    struct WockyJingleSessionClass {
        GObjectClass parent_class;
    };

### wocky_jingle_session_new ()

    WockyJingleSession * wocky_jingle_session_new           (WockyJingleFactory *factory,
                                                             WockyPorter *porter,
                                                             const gchar *session_id,
                                                             gboolean local_initiator,
                                                             WockyContact *peer,
                                                             WockyJingleDialect dialect,
                                                             gboolean local_hold);

### wocky_jingle_session_detect ()

    const gchar *       wocky_jingle_session_detect         (WockyStanza *stanza,
                                                             WockyJingleAction *action,
                                                             WockyJingleDialect *dialect);

### wocky_jingle_session_parse ()

    gboolean            wocky_jingle_session_parse          (WockyJingleSession *sess,
                                                             WockyJingleAction action,
                                                             WockyStanza *stanza,
                                                             GError **error);

### wocky_jingle_session_new_message ()

    WockyStanza *       wocky_jingle_session_new_message    (WockyJingleSession *sess,
                                                             WockyJingleAction action,
                                                             WockyNode **sess_node);

### wocky_jingle_session_accept ()

    void                wocky_jingle_session_accept         (WockyJingleSession *sess);

For incoming calls, accepts the call. For outgoing calls, indicates that the initial contents for the call have been created and the offer can be sent to the peer.

The acceptance or offer will only be signalled to the peer once all contents are ready (as returned by `wocky_jingle_content_is_ready()`). For an RTP session with WockyJingleMediaRtp contents, this translates to a media description and transport candidates having been provided to all contents.

`sess` : | the session.

### wocky_jingle_session_terminate ()

    gboolean            wocky_jingle_session_terminate      (WockyJingleSession *sess,
                                                             WockyJingleReason reason,
                                                             const gchar *text,
                                                             GError **error);

Ends a session.

If called for an outgoing session which has not yet been signalled to the peer (perhaps because `wocky_jingle_session_accept()` has not been called, or codecs or candidates have not been provided), the session will quietly terminate without the peer hearing anything about it.

If called for an already-terminated session, this is a no-op.

`sess` : | the session
`reason` : | the reason the session should be terminated
`text` : | human-readable information about why the session terminated. [allow-none]
`error` : | Unused, because this function never fails.
Returns : | `TRUE`.

### wocky_jingle_session_remove_content ()

    void                wocky_jingle_session_remove_content (WockyJingleSession *sess,
                                                             WockyJingleContent *c);

### wocky_jingle_session_add_content ()

    WockyJingleContent * wocky_jingle_session_add_content   (WockyJingleSession *sess,
                                                             WockyJingleMediaType mtype,
                                                             WockyJingleContentSenders senders,
                                                             const char *name,
                                                             const gchar *content_ns,
                                                             const gchar *transport_ns);

Adds a content to the session. Once it has its codecs and transport candidates filled in, it will be signalled to the peer (either as part of the session-initiate, if it has not been sent yet, or as a content-add if `sess` has already been initiated).

Legal values for `content_ns` and `transport_ns` depend on the Jingle dialect in use for this session (and in some cases on `mtype`); sensible values depend on the peer's capabilities.

`sess` : | the session
`mtype` : | what kind of media will be exchanged on the content
`senders` : | which directions media should initially flow in.
`name` : | a descriptive name to use for the content; this is typically not shown to users. [allow-none]
`content_ns` : | the namespace to use for the content's description
`transport_ns` : | the namespace of the media transport to use for the call
Returns : | the new content, which is guaranteed not to be `NULL`. [transfer none]

### wocky_jingle_session_get_content_type ()

    GType               wocky_jingle_session_get_content_type
                                                            (WockyJingleSession *Param1);

### wocky_jingle_session_get_contents ()

    GList *             wocky_jingle_session_get_contents   (WockyJingleSession *sess);

### wocky_jingle_session_get_peer_resource ()

    const gchar *       wocky_jingle_session_get_peer_resource
                                                            (WockyJingleSession *sess);

### wocky_jingle_session_get_initiator ()

    const gchar *       wocky_jingle_session_get_initiator  (WockyJingleSession *sess);

### wocky_jingle_session_get_sid ()

    const gchar *       wocky_jingle_session_get_sid        (WockyJingleSession *sess);

### wocky_jingle_session_get_dialect ()

    WockyJingleDialect  wocky_jingle_session_get_dialect    (WockyJingleSession *sess);

### wocky_jingle_session_can_modify_contents ()

    gboolean            wocky_jingle_session_can_modify_contents
                                                            (WockyJingleSession *sess);

### wocky_jingle_session_peer_has_cap ()

    gboolean            wocky_jingle_session_peer_has_cap   (WockyJingleSession *self,
                                                             const gchar *cap_or_quirk);

### wocky_jingle_session_send ()

    void                wocky_jingle_session_send           (WockyJingleSession *sess,
                                                             WockyStanza *stanza);

A shorthand for sending a Jingle IQ without waiting for the reply.

`sess` : | a session
`stanza` : | a stanza, of which this function will take ownership. [transfer full]

### wocky_jingle_session_set_local_hold ()

    void                wocky_jingle_session_set_local_hold (WockyJingleSession *sess,
                                                             gboolean held);

### wocky_jingle_session_get_remote_hold ()

    gboolean            wocky_jingle_session_get_remote_hold
                                                            (WockyJingleSession *sess);

### wocky_jingle_session_get_remote_ringing ()

    gboolean            wocky_jingle_session_get_remote_ringing
                                                            (WockyJingleSession *sess);

### wocky_jingle_session_defines_action ()

    gboolean            wocky_jingle_session_defines_action (WockyJingleSession *sess,
                                                             WockyJingleAction action);

### wocky_jingle_session_get_peer_contact ()

    WockyContact *      wocky_jingle_session_get_peer_contact
                                                            (WockyJingleSession *self);

### wocky_jingle_session_get_peer_jid ()

    const gchar *       wocky_jingle_session_get_peer_jid   (WockyJingleSession *sess);

### wocky_jingle_session_get_reason_name ()

    const gchar *       wocky_jingle_session_get_reason_name
                                                            (WockyJingleReason reason);

### wocky_jingle_session_get_factory ()

    WockyJingleFactory * wocky_jingle_session_get_factory   (WockyJingleSession *self);

### wocky_jingle_session_get_porter ()

    WockyPorter *       wocky_jingle_session_get_porter     (WockyJingleSession *self);

### wocky_jingle_session_acknowledge_iq ()

    void                wocky_jingle_session_acknowledge_iq (WockyJingleSession *self,
                                                             WockyStanza *stanza);