Fri, 23 May 2008 02:42:32 +0000
Updates voice and video to use Farsight 2, gets XMPP voice conferences
closer to XEP-0167, and fixes a lot of bugs.
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
1 | /* |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
2 | * purple - Jabber Protocol Plugin |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
3 | * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
4 | * This program is free software; you can redistribute it and/or modify |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
5 | * it under the terms of the GNU General Public License as published by |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
6 | * the Free Software Foundation; either version 2 of the License, or |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
7 | * (at your option) any later version. |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
8 | * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
9 | * This program is distributed in the hope that it will be useful, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
12 | * GNU General Public License for more details. |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
13 | * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
14 | * You should have received a copy of the GNU General Public License |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
15 | * along with this program; if not, write to the Free Software |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
17 | * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
18 | */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
19 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
20 | #include "config.h" |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
21 | #include "purple.h" |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
22 | #include "jingle.h" |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
23 | #include "xmlnode.h" |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
24 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
25 | #include <stdlib.h> |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
26 | #include <string.h> |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
27 | #include <glib.h> |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
28 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
29 | #ifdef USE_FARSIGHT |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
30 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
31 | #include <gst/farsight/fs-candidate.h> |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
32 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
33 | /* keep a hash table of JingleSessions */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
34 | static GHashTable *sessions = NULL; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
35 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
36 | static gboolean |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
37 | jabber_jingle_session_equal(gconstpointer a, gconstpointer b) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
38 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
39 | purple_debug_info("jingle", |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
40 | "jabber_jingle_session_equal, comparing %s and %s\n", |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
41 | ((JingleSession *)a)->id, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
42 | ((JingleSession *)b)->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
43 | return !strcmp(((JingleSession *) a)->id, ((JingleSession *) b)->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
44 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
45 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
46 | static JingleSession * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
47 | jabber_jingle_session_create_internal(JabberStream *js, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
48 | const char *id) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
49 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
50 | JingleSession *sess = g_new0(JingleSession, 1); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
51 | sess->js = js; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
52 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
53 | if (id) { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
54 | sess->id = g_strdup(id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
55 | } else if (js) { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
56 | /* init the session ID... */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
57 | sess->id = jabber_get_next_id(js); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
58 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
59 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
60 | /* insert it into the hash table */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
61 | if (!sessions) { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
62 | purple_debug_info("jingle", "Creating hash table for sessions\n"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
63 | sessions = g_hash_table_new(g_str_hash, g_str_equal); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
64 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
65 | purple_debug_info("jingle", "inserting session with key: %s into table\n", |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
66 | sess->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
67 | g_hash_table_insert(sessions, sess->id, sess); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
68 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
69 | sess->session_started = FALSE; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
70 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
71 | return sess; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
72 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
73 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
74 | JabberStream * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
75 | jabber_jingle_session_get_js(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
76 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
77 | return sess->js; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
78 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
79 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
80 | JingleSession * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
81 | jabber_jingle_session_create(JabberStream *js) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
82 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
83 | JingleSession *sess = jabber_jingle_session_create_internal(js, NULL); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
84 | sess->is_initiator = TRUE; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
85 | return sess; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
86 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
87 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
88 | JingleSession * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
89 | jabber_jingle_session_create_by_id(JabberStream *js, const char *id) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
90 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
91 | JingleSession *sess = jabber_jingle_session_create_internal(js, id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
92 | sess->is_initiator = FALSE; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
93 | return sess; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
94 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
95 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
96 | const char * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
97 | jabber_jingle_session_get_id(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
98 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
99 | return sess->id; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
100 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
101 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
102 | void |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
103 | jabber_jingle_session_destroy(JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
104 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
105 | g_hash_table_remove(sessions, sess->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
106 | g_free(sess->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
107 | g_free(sess); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
108 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
109 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
110 | JingleSession * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
111 | jabber_jingle_session_find_by_id(const char *id) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
112 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
113 | purple_debug_info("jingle", "find_by_id %s\n", id); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
114 | purple_debug_info("jingle", "hash table: %p\n", sessions); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
115 | purple_debug_info("jingle", "hash table size %d\n", |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
116 | g_hash_table_size(sessions)); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
117 | purple_debug_info("jingle", "lookup: %p\n", g_hash_table_lookup(sessions, id)); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
118 | return (JingleSession *) g_hash_table_lookup(sessions, id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
119 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
120 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
121 | GList * |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
122 | jabber_jingle_session_find_by_js(JabberStream *js) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
123 | { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
124 | GList *values = g_hash_table_get_values(sessions); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
125 | GList *iter = values; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
126 | GList *found = NULL; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
127 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
128 | for (; iter; iter = iter->next) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
129 | JingleSession *session = (JingleSession *)iter->data; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
130 | if (session->js == js) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
131 | found = g_list_prepend(found, session); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
132 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
133 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
134 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
135 | g_list_free(values); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
136 | return found; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
137 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
138 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
139 | JingleSession *jabber_jingle_session_find_by_jid(JabberStream *js, const char *jid) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
140 | { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
141 | GList *values = g_hash_table_get_values(sessions); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
142 | GList *iter = values; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
143 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
144 | for (; iter; iter = iter->next) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
145 | JingleSession *session = (JingleSession *)iter->data; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
146 | if (session->js == js && !strcmp(jid, session->remote_jid)) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
147 | g_list_free(values); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
148 | return session; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
149 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
150 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
151 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
152 | g_list_free(values); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
153 | return NULL; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
154 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
155 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
156 | GList * |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
157 | jabber_jingle_get_codecs(const xmlnode *description) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
158 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
159 | GList *codecs = NULL; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
160 | xmlnode *codec_element = NULL; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
161 | const char *encoding_name,*id, *clock_rate; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
162 | FsCodec *codec; |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
163 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
164 | for (codec_element = xmlnode_get_child(description, "payload-type") ; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
165 | codec_element ; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
166 | codec_element = xmlnode_get_next_twin(codec_element)) { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
167 | encoding_name = xmlnode_get_attrib(codec_element, "name"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
168 | id = xmlnode_get_attrib(codec_element, "id"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
169 | clock_rate = xmlnode_get_attrib(codec_element, "clockrate"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
170 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
171 | codec = fs_codec_new(atoi(id), encoding_name, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
172 | FS_MEDIA_TYPE_AUDIO, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
173 | clock_rate ? atoi(clock_rate) : 0); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
174 | codecs = g_list_append(codecs, codec); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
175 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
176 | return codecs; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
177 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
178 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
179 | GList * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
180 | jabber_jingle_get_candidates(const xmlnode *transport) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
181 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
182 | GList *candidates = NULL; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
183 | xmlnode *candidate = NULL; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
184 | FsCandidate *c; |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
185 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
186 | for (candidate = xmlnode_get_child(transport, "candidate") ; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
187 | candidate ; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
188 | candidate = xmlnode_get_next_twin(candidate)) { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
189 | const char *type = xmlnode_get_attrib(candidate, "type"); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
190 | c = fs_candidate_new(xmlnode_get_attrib(candidate, "component"), |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
191 | atoi(xmlnode_get_attrib(candidate, "component")), |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
192 | strcmp(type, "host") == 0 ? |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
193 | FS_CANDIDATE_TYPE_HOST : |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
194 | strcmp(type, "prflx") == 0 ? |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
195 | FS_CANDIDATE_TYPE_PRFLX : |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
196 | FS_CANDIDATE_TYPE_RELAY, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
197 | strcmp(xmlnode_get_attrib(candidate, "protocol"), |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
198 | "udp") == 0 ? |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
199 | FS_NETWORK_PROTOCOL_UDP : |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
200 | FS_NETWORK_PROTOCOL_TCP, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
201 | xmlnode_get_attrib(candidate, "ip"), |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
202 | atoi(xmlnode_get_attrib(candidate, "port"))); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
203 | candidates = g_list_append(candidates, c); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
204 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
205 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
206 | return candidates; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
207 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
208 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
209 | PurpleMedia * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
210 | jabber_jingle_session_get_media(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
211 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
212 | return sess->media; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
213 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
214 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
215 | void |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
216 | jabber_jingle_session_set_media(JingleSession *sess, PurpleMedia *media) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
217 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
218 | sess->media = media; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
219 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
220 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
221 | const char * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
222 | jabber_jingle_session_get_remote_jid(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
223 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
224 | return sess->remote_jid; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
225 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
226 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
227 | void |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
228 | jabber_jingle_session_set_remote_jid(JingleSession *sess, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
229 | const char *remote_jid) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
230 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
231 | sess->remote_jid = strdup(remote_jid); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
232 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
233 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
234 | const char * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
235 | jabber_jingle_session_get_initiator(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
236 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
237 | return sess->initiator; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
238 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
239 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
240 | void |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
241 | jabber_jingle_session_set_initiator(JingleSession *sess, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
242 | const char *initiator) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
243 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
244 | sess->initiator = g_strdup(initiator); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
245 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
246 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
247 | gboolean |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
248 | jabber_jingle_session_is_initiator(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
249 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
250 | return sess->is_initiator; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
251 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
252 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
253 | static xmlnode * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
254 | jabber_jingle_session_create_jingle_element(const JingleSession *sess, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
255 | const char *action) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
256 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
257 | xmlnode *jingle = xmlnode_new("jingle"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
258 | xmlnode_set_namespace(jingle, "urn:xmpp:tmp:jingle"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
259 | xmlnode_set_attrib(jingle, "action", action); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
260 | xmlnode_set_attrib(jingle, "initiator", |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
261 | jabber_jingle_session_get_initiator(sess)); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
262 | xmlnode_set_attrib(jingle, "responder", |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
263 | jabber_jingle_session_is_initiator(sess) ? |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
264 | jabber_jingle_session_get_remote_jid(sess) : |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
265 | jabber_jingle_session_get_initiator(sess)); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
266 | xmlnode_set_attrib(jingle, "sid", sess->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
267 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
268 | return jingle; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
269 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
270 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
271 | xmlnode * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
272 | jabber_jingle_session_create_terminate(const JingleSession *sess, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
273 | const char *reasoncode, |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
274 | const char *reasontext) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
275 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
276 | xmlnode *jingle = |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
277 | jabber_jingle_session_create_jingle_element(sess, "session-terminate"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
278 | xmlnode_set_attrib(jingle, "resoncode", reasoncode); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
279 | if (reasontext) { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
280 | xmlnode_set_attrib(jingle, "reasontext", reasontext); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
281 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
282 | xmlnode_set_attrib(jingle, "sid", sess->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
283 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
284 | return jingle; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
285 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
286 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
287 | xmlnode * |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
288 | jabber_jingle_session_create_description(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
289 | { |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
290 | GList *codecs = purple_media_get_local_audio_codecs(sess->media); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
291 | xmlnode *description = xmlnode_new("description"); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
292 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
293 | xmlnode_set_namespace(description, "urn:xmpp:tmp:jingle:apps:audio-rtp"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
294 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
295 | /* get codecs */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
296 | for (; codecs ; codecs = codecs->next) { |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
297 | FsCodec *codec = (FsCodec*)codecs->data; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
298 | char id[8], clockrate[10], channels[10]; |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
299 | xmlnode *payload = xmlnode_new_child(description, "payload-type"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
300 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
301 | g_snprintf(id, sizeof(id), "%d", codec->id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
302 | g_snprintf(clockrate, sizeof(clockrate), "%d", codec->clock_rate); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
303 | g_snprintf(channels, sizeof(channels), "%d", codec->channels); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
304 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
305 | xmlnode_set_attrib(payload, "name", codec->encoding_name); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
306 | xmlnode_set_attrib(payload, "id", id); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
307 | xmlnode_set_attrib(payload, "clockrate", clockrate); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
308 | xmlnode_set_attrib(payload, "channels", channels); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
309 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
310 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
311 | fs_codec_list_destroy(codecs); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
312 | return description; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
313 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
314 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
315 | static guint |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
316 | jabber_jingle_get_priority(guint type, guint network) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
317 | { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
318 | switch (type) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
319 | case FS_CANDIDATE_TYPE_HOST: |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
320 | return network == 0 ? 4096 : network == 1 ? 2048 : 1024; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
321 | break; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
322 | case FS_CANDIDATE_TYPE_PRFLX: |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
323 | return 126; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
324 | break; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
325 | case FS_CANDIDATE_TYPE_RELAY: |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
326 | return 100; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
327 | break; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
328 | default: |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
329 | return 0; /* unknown type, should not happen */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
330 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
331 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
332 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
333 | static xmlnode * |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
334 | jabber_jingle_session_create_candidate_info(FsCandidate *c, FsCandidate *remote) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
335 | { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
336 | char port[8]; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
337 | char prio[8]; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
338 | char component[8]; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
339 | xmlnode *candidate = NULL; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
340 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
341 | candidate = xmlnode_new("candidate"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
342 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
343 | g_snprintf(port, sizeof(port), "%d", c->port); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
344 | g_snprintf(prio, sizeof(prio), "%d", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
345 | jabber_jingle_get_priority(c->type, 0)); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
346 | g_snprintf(component, sizeof(component), "%d", c->component_id); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
347 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
348 | xmlnode_set_attrib(candidate, "component", component); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
349 | xmlnode_set_attrib(candidate, "foundation", "1"); /* what about this? */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
350 | xmlnode_set_attrib(candidate, "generation", "0"); /* ? */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
351 | xmlnode_set_attrib(candidate, "ip", c->ip); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
352 | xmlnode_set_attrib(candidate, "network", "0"); /* ? */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
353 | xmlnode_set_attrib(candidate, "port", port); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
354 | xmlnode_set_attrib(candidate, "priority", prio); /* Is this correct? */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
355 | xmlnode_set_attrib(candidate, "protocol", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
356 | c->proto == FS_NETWORK_PROTOCOL_UDP ? |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
357 | "udp" : "tcp"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
358 | if (c->username) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
359 | xmlnode_set_attrib(candidate, "ufrag", c->username); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
360 | if (c->password) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
361 | xmlnode_set_attrib(candidate, "pwd", c->password); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
362 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
363 | xmlnode_set_attrib(candidate, "type", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
364 | c->type == FS_CANDIDATE_TYPE_HOST ? |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
365 | "host" : |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
366 | c->type == FS_CANDIDATE_TYPE_PRFLX ? |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
367 | "prflx" : |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
368 | c->type == FS_CANDIDATE_TYPE_RELAY ? |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
369 | "relay" : NULL); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
370 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
371 | /* relay */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
372 | if (c->type == FS_CANDIDATE_TYPE_RELAY) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
373 | /* set rel-addr and rel-port? How? */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
374 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
375 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
376 | if (remote) { |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
377 | char remote_port[8]; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
378 | g_snprintf(remote_port, sizeof(remote_port), "%d", remote->port); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
379 | xmlnode_set_attrib(candidate, "rem-addr", remote->ip); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
380 | xmlnode_set_attrib(candidate, "rem-port", remote_port); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
381 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
382 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
383 | return candidate; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
384 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
385 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
386 | /* split into two separate methods, one to generate session-accept |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
387 | (includes codecs) and one to generate transport-info (includes transports |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
388 | candidates) */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
389 | xmlnode * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
390 | jabber_jingle_session_create_session_accept(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
391 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
392 | xmlnode *jingle = |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
393 | jabber_jingle_session_create_jingle_element(sess, "session-accept"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
394 | xmlnode *content = NULL; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
395 | xmlnode *description = NULL; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
396 | xmlnode *transport = NULL; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
397 | xmlnode *candidate = NULL; |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
398 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
399 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
400 | content = xmlnode_new_child(jingle, "content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
401 | xmlnode_set_attrib(content, "creator", "initiator"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
402 | xmlnode_set_attrib(content, "name", "audio-content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
403 | xmlnode_set_attrib(content, "profile", "RTP/AVP"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
404 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
405 | description = jabber_jingle_session_create_description(sess); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
406 | xmlnode_insert_child(content, description); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
407 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
408 | transport = xmlnode_new_child(content, "transport"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
409 | xmlnode_set_namespace(transport, "urn:xmpp:tmp:jingle:transports:ice-udp"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
410 | candidate = jabber_jingle_session_create_candidate_info( |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
411 | purple_media_get_local_candidate(sess->media), |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
412 | purple_media_get_remote_candidate(sess->media)); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
413 | xmlnode_insert_child(transport, candidate); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
414 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
415 | return jingle; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
416 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
417 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
418 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
419 | xmlnode * |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
420 | jabber_jingle_session_create_transport_info(const JingleSession *sess) |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
421 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
422 | xmlnode *jingle = |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
423 | jabber_jingle_session_create_jingle_element(sess, "transport-info"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
424 | xmlnode *content = NULL; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
425 | xmlnode *transport = NULL; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
426 | GList *candidates = purple_media_get_local_audio_candidates(sess->media); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
427 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
428 | content = xmlnode_new_child(jingle, "content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
429 | xmlnode_set_attrib(content, "creator", "initiator"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
430 | xmlnode_set_attrib(content, "name", "audio-content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
431 | xmlnode_set_attrib(content, "profile", "RTP/AVP"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
432 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
433 | transport = xmlnode_new_child(content, "transport"); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
434 | xmlnode_set_namespace(transport, "urn:xmpp:tmp:jingle:transports:ice-udp"); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
435 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
436 | /* get transport candidate */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
437 | for (; candidates ; candidates = candidates->next) { |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
438 | FsCandidate *c = (FsCandidate *) candidates->data; |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
439 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
440 | if (!strcmp(c->ip, "127.0.0.1")) { |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
441 | continue; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
442 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
443 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
444 | xmlnode_insert_child(transport, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
445 | jabber_jingle_session_create_candidate_info(c, NULL)); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
446 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
447 | fs_candidate_list_destroy(candidates); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
448 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
449 | return jingle; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
450 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
451 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
452 | xmlnode * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
453 | jabber_jingle_session_create_content_replace(const JingleSession *sess, |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
454 | FsCandidate *native_candidate, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
455 | FsCandidate *remote_candidate) |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
456 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
457 | xmlnode *jingle = |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
458 | jabber_jingle_session_create_jingle_element(sess, "content-replace"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
459 | xmlnode *content = NULL; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
460 | xmlnode *transport = NULL; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
461 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
462 | purple_debug_info("jingle", "creating content-modify for native candidate %s " \ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
463 | ", remote candidate %s\n", native_candidate->candidate_id, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
464 | remote_candidate->candidate_id); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
465 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
466 | content = xmlnode_new_child(jingle, "content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
467 | xmlnode_set_attrib(content, "creator", "initiator"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
468 | xmlnode_set_attrib(content, "name", "audio-content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
469 | xmlnode_set_attrib(content, "profile", "RTP/AVP"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
470 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
471 | /* get top codec from codec_intersection to put here... */ |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
472 | /* later on this should probably handle changing codec */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
473 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
474 | xmlnode_insert_child(content, jabber_jingle_session_create_description(sess)); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
475 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
476 | transport = xmlnode_new_child(content, "transport"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
477 | xmlnode_set_namespace(transport, "urn:xmpp:tmp:jingle:transports:ice-udp"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
478 | xmlnode_insert_child(transport, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
479 | jabber_jingle_session_create_candidate_info(native_candidate, |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
480 | remote_candidate)); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
481 | |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
482 | purple_debug_info("jingle", "End create content modify\n"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
483 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
484 | return jingle; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
485 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
486 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
487 | xmlnode * |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
488 | jabber_jingle_session_create_content_accept(const JingleSession *sess) |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
489 | { |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
490 | xmlnode *jingle = |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
491 | jabber_jingle_session_create_jingle_element(sess, "content-accept"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
492 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
493 | xmlnode *content = xmlnode_new_child(jingle, "content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
494 | xmlnode *description = jabber_jingle_session_create_description(sess); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
495 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
496 | xmlnode_set_attrib(content, "creator", "initiator"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
497 | xmlnode_set_attrib(content, "name", "audio-content"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
498 | xmlnode_set_attrib(content, "profile", "RTP/AVP"); |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
499 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22649
diff
changeset
|
500 | xmlnode_insert_child(content, description); |
|
22649
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
501 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
502 | return jingle; |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
503 | } |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
504 | |
|
d29483a90e40
Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
505 | #endif /* USE_FARSIGHT */ |