19 * USA |
19 * USA |
20 */ |
20 */ |
21 |
21 |
22 #include <glib.h> |
22 #include <glib.h> |
23 |
23 |
|
24 #include <mcabber/logprint.h> |
|
25 |
24 #include <jingle/jingle.h> |
26 #include <jingle/jingle.h> |
25 #include <jingle/check.h> |
27 #include <jingle/check.h> |
26 |
28 |
27 |
29 |
28 void handle_session_initiate(LmMessage *m, JingleNode *jn) |
30 void handle_session_initiate(LmMessage *m, JingleNode *jn) |
29 { |
31 { |
|
32 GError *err = NULL; |
|
33 |
|
34 if (!check_contents(jn, &err)) { |
|
35 scr_log_print(LPRINT_DEBUG, "jingle: One of the content element was invalid (%s)", |
|
36 err->message); |
|
37 jingle_send_iq_error(m, "cancel", "bad-request", NULL); |
|
38 return; |
|
39 } |
|
40 |
30 // a session-initiate message must contains at least one <content> element |
41 // a session-initiate message must contains at least one <content> element |
31 if (g_slist_length(jn->content) < 1) { |
42 if (g_slist_length(jn->content) < 1) { |
32 jingle_send_iq_error(m, "cancel", "bad-request", NULL); |
43 jingle_send_iq_error(m, "cancel", "bad-request", NULL); |
33 return; |
44 return; |
34 } |
45 } |
|
46 |
|
47 |
35 |
48 |
36 /*// if a session with the same sid already exists |
49 /*// if a session with the same sid already exists |
37 if (session_find(jn) != NULL) { |
50 if (session_find(jn) != NULL) { |
38 jingle_send_iq_error(m, "cancel", "unexpected-request", "out-of-order"); |
51 jingle_send_iq_error(m, "cancel", "unexpected-request", "out-of-order"); |
39 return; |
52 return; |