diff -r c0341c164405 -r 76ce876f7935 jingle/action-handlers.c --- a/jingle/action-handlers.c Fri Aug 13 20:34:44 2010 +0200 +++ b/jingle/action-handlers.c Fri Aug 13 22:42:29 2010 +0200 @@ -336,6 +336,48 @@ g_free(disp); } +void handle_session_info(JingleNode *jn) +{ + JingleSession *sess; + SessionContent *sc; + GSList *el; + + if ((sess = session_find(jn)) == NULL) { + jingle_send_iq_error(jn->message, "cancel", "item-not-found", "unknown-session"); + return; + } + + /* "If either party receives an empty session-info message + * for an active session, it MUST send an empty IQ result; + * this usage functions as a "ping" to determine session + * vitality via the XMPP signalling channel." */ + if (jn->node->children == NULL) { + jingle_ack_iq(jn->message); + return; + } + + /* We don't know the app to which the message is addressed. + * Only the app module itself may know, based on the element + * name and its xmlns, so we need to try every app module. */ + for (el = sess->content; el; el = el->next) { + sc = (SessionContent*)el->data; + if (sc->appfuncs->handle == NULL) + continue; + + if (sc->appfuncs->handle(JINGLE_SESSION_INFO, sc->description, + jn->node->children)) { + jingle_ack_iq(jn->message); + return; + } + } + /* "If the party that receives an informational message + * does not understand the payload, it MUST return a + * error with a Jingle-specific + * error condition of ." */ + jingle_send_iq_error(jn->message, "modify", "feature-not-implemented", + "unsupported-info"); +} + void handle_session_accept(JingleNode *jn) { JingleSession *sess;