jingle/action-handlers.c
changeset 133 361d8577ebd1
parent 128 cded9f40039e
child 148 cb40539b88b7
equal deleted inserted replaced
132:4fef4ced1e97 133:361d8577ebd1
   103 
   103 
   104   // We create a session
   104   // We create a session
   105   sess = session_new_from_jinglenode(jn);
   105   sess = session_new_from_jinglenode(jn);
   106   
   106   
   107   for (child = jn->content; child; child = child->next) {
   107   for (child = jn->content; child; child = child->next) {
       
   108     SessionContent *sc;
   108     cn = (JingleContent *)(child->data);
   109     cn = (JingleContent *)(child->data);
   109     
   110     
   110     xmlns = lm_message_node_get_attribute(cn->description, "xmlns");
   111     xmlns = lm_message_node_get_attribute(cn->description, "xmlns");
   111     appfuncs = jingle_get_appfuncs(xmlns);
   112     appfuncs = jingle_get_appfuncs(xmlns);
   112     if (appfuncs == NULL) continue;
   113     if (appfuncs == NULL) continue;
   113     
   114     
   114     xmlns = lm_message_node_get_attribute(cn->transport, "xmlns");
   115     xmlns = lm_message_node_get_attribute(cn->transport, "xmlns");
   115     transfuncs = jingle_get_transportfuncs(xmlns);
   116     transfuncs = jingle_get_transportfuncs(xmlns);
   116     if (transfuncs == NULL) continue;
   117     if (transfuncs == NULL) continue;
   117     
   118     
   118     description = appfuncs->check(cn, &err);
   119     sc = session_add_content_from_jinglecontent(sess, cn,
   119     if (description == NULL || err != NULL) continue;
   120                                                 JINGLE_SESSION_STATE_PENDING,
   120     transport = transfuncs->check(cn, &err);
   121                                                 &err);
   121     if (transport == NULL || err != NULL) continue;
   122     if (err != NULL || sc == NULL) {
   122     
   123       scr_LogPrint(LPRINT_LOGNORM, "Cannot add a content: %s", err->message);
   123     session_add_content_from_jinglecontent(sess, cn,
   124       g_error_free(err);
   124                                            JINGLE_SESSION_STATE_PENDING);
   125     }
   125   }
   126   }
   126   
   127 
   127   if(g_slist_length(sess->content) == 0) {
   128   if(g_slist_length(sess->content) == 0) {
   128     jingle_send_session_terminate(sess, "unsupported-applications");
   129     jingle_send_session_terminate(sess, "unsupported-applications");
   129     session_delete(sess);
   130     session_delete(sess);
   130     return;
   131     return;
   131   }
   132   }