[asterisk-commits] phsultan: trunk r83076 - /trunk/channels/chan_jingle.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Sep 19 08:55:08 CDT 2007
Author: phsultan
Date: Wed Sep 19 08:55:08 2007
New Revision: 83076
URL: http://svn.digium.com/view/asterisk?view=rev&rev=83076
Log:
Replace Google namespace occurrences with Jingle. The former namespace
is handled by chan_gtalk.
Modified:
trunk/channels/chan_jingle.c
Modified: trunk/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_jingle.c?view=diff&rev=83076&r1=83075&r2=83076
==============================================================================
--- trunk/channels/chan_jingle.c (original)
+++ trunk/channels/chan_jingle.c Wed Sep 19 08:55:08 2007
@@ -324,10 +324,10 @@
return 1;
iq = iks_new("iq");
- jingle = iks_new(GOOGLE_NODE);
+ jingle = iks_new(JINGLE_NODE);
dcodecs = iks_new("description");
if (iq && jingle && dcodecs) {
- iks_insert_attrib(dcodecs, "xmlns", "http://www.google.com/session/phone");
+ iks_insert_attrib(dcodecs, "xmlns", JINGLE_AUDIO_RTP_NS);
for (x = 0; x < 32; x++) {
if (!(pref_codec = ast_codec_pref_index(&client->prefs, x)))
@@ -358,10 +358,10 @@
iks_insert_attrib(iq, "id", client->connection->mid);
ast_aji_increment_mid(client->connection->mid);
- iks_insert_attrib(jingle, "xmlns", GOOGLE_NS);
+ iks_insert_attrib(jingle, "xmlns", JINGLE_NS);
iks_insert_attrib(jingle, "type", JINGLE_ACCEPT);
iks_insert_attrib(jingle, "initiator", p->initiator ? client->connection->jid->full : p->from);
- iks_insert_attrib(jingle, GOOGLE_SID, tmp->sid);
+ iks_insert_attrib(jingle, JINGLE_SID, tmp->sid);
iks_insert_node(iq, jingle);
iks_insert_node(jingle, dcodecs);
iks_insert_node(dcodecs, payload_red);
@@ -487,7 +487,7 @@
ast_debug(1, "The client is %s\n", client->name);
/* Make sure our new call doesn't exist yet */
for (tmp = client->p; tmp; tmp = tmp->next) {
- if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid))
+ if (iks_find_with_attrib(pak->x, JINGLE_NODE, JINGLE_SID, tmp->sid))
break;
}
@@ -507,7 +507,7 @@
char *dtmf;
/* Make sure our new call doesn't exist yet */
for (tmp = client->p; tmp; tmp = tmp->next) {
- if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid) || iks_find_with_attrib(pak->x, JINGLE_NODE, JINGLE_SID, tmp->sid))
+ if (iks_find_with_attrib(pak->x, JINGLE_NODE, JINGLE_SID, tmp->sid))
break;
}
@@ -571,7 +571,7 @@
ast_debug(1, "The client is %s\n", client->name);
/* Make sure our new call doesn't exist yet */
for (tmp = client->p; tmp; tmp = tmp->next) {
- if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid))
+ if (iks_find_with_attrib(pak->x, JINGLE_NODE, JINGLE_SID, tmp->sid))
break;
}
@@ -598,7 +598,7 @@
iq = iks_new("iq");
- jingle = iks_new(GOOGLE_NODE);
+ jingle = iks_new(JINGLE_NODE);
candidate = iks_new("candidate");
if (!iq || !jingle || !candidate) {
ast_log(LOG_ERROR, "Memory allocation error\n");
@@ -670,7 +670,7 @@
iks_insert_attrib(jingle, "type", "candidates");
iks_insert_attrib(jingle, "id", sid);
iks_insert_attrib(jingle, "initiator", (p->initiator) ? c->jid->full : from);
- iks_insert_attrib(jingle, "xmlns", GOOGLE_NS);
+ iks_insert_attrib(jingle, "xmlns", JINGLE_NS);
iks_insert_attrib(candidate, "name", tmp->name);
iks_insert_attrib(candidate, "address", tmp->ip);
iks_insert_attrib(candidate, "port", port);
@@ -867,7 +867,7 @@
iks_insert_attrib(session, "id", p->sid);
iks_insert_attrib(session, "initiator",
p->initiator ? client->connection->jid->full : p->from);
- iks_insert_attrib(session, "xmlns", GOOGLE_NS);
+ iks_insert_attrib(session, "xmlns", JINGLE_NS);
iks_insert_node(request, session);
iks_send(client->connection->p, request);
iks_delete(session);
@@ -925,7 +925,7 @@
/* Make sure our new call doesn't exist yet */
while (tmp) {
- if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid)) {
+ if (iks_find_with_attrib(pak->x, JINGLE_NODE, JINGLE_SID, tmp->sid)) {
ast_log(LOG_NOTICE, "Ignoring duplicate call setup on SID %s\n", tmp->sid);
jingle_response(client, pak, "out-of-order", NULL);
return -1;
@@ -933,7 +933,7 @@
tmp = tmp->next;
}
- p = jingle_alloc(client, pak->from->partial, iks_find_attrib(pak->query, GOOGLE_SID));
+ p = jingle_alloc(client, pak->from->partial, iks_find_attrib(pak->query, JINGLE_SID));
if (!p) {
ast_log(LOG_WARNING, "Unable to allocate jingle structure!\n");
return -1;
@@ -942,8 +942,8 @@
if (chan) {
ast_mutex_lock(&p->lock);
ast_copy_string(p->from, pak->from->full, sizeof(p->from));
- if (iks_find_attrib(pak->query, GOOGLE_SID)) {
- ast_copy_string(p->sid, iks_find_attrib(pak->query, GOOGLE_SID),
+ if (iks_find_attrib(pak->query, JINGLE_SID)) {
+ ast_copy_string(p->sid, iks_find_attrib(pak->query, JINGLE_SID),
sizeof(p->sid));
}
@@ -971,7 +971,7 @@
case AST_PBX_SUCCESS:
jingle_response(client, pak, NULL, NULL);
jingle_create_candidates(client, p,
- iks_find_attrib(pak->query, GOOGLE_SID),
+ iks_find_attrib(pak->query, JINGLE_SID),
iks_find_attrib(pak->x, "from"));
/* nothing to do */
break;
@@ -1019,7 +1019,7 @@
if (!newcandidate)
return 0;
for (tmp = client->p; tmp; tmp = tmp->next) {
- if (iks_find_with_attrib(pak->x, GOOGLE_NODE, GOOGLE_SID, tmp->sid)) {
+ if (iks_find_with_attrib(pak->x, JINGLE_NODE, JINGLE_SID, tmp->sid)) {
p = tmp;
break;
}
@@ -1453,20 +1453,20 @@
{
struct jingle *client = ASTOBJ_REF((struct jingle *) data);
- if (iks_find_with_attrib(pak->x, GOOGLE_NODE, "type", JINGLE_INITIATE)) {
+ if (iks_find_with_attrib(pak->x, JINGLE_NODE, "type", JINGLE_INITIATE)) {
/* New call */
jingle_newcall(client, pak);
- } else if (iks_find_with_attrib(pak->x, GOOGLE_NODE, "type", GOOGLE_NEGOTIATE)) {
+ } else if (iks_find_with_attrib(pak->x, JINGLE_NODE, "type", JINGLE_NEGOTIATE)) {
ast_debug(3, "About to add candidate!\n");
jingle_add_candidate(client, pak);
ast_debug(3, "Candidate Added!\n");
- } else if (iks_find_with_attrib(pak->x, GOOGLE_NODE, "type", GOOGLE_ACCEPT)) {
+ } else if (iks_find_with_attrib(pak->x, JINGLE_NODE, "type", JINGLE_ACCEPT)) {
jingle_is_answered(client, pak);
- } else if (iks_find_with_attrib(pak->x, GOOGLE_NODE, "type", "session-info") || iks_find_with_attrib(pak->x, JINGLE_NODE, "action", "session-info")) {
+ } else if (iks_find_with_attrib(pak->x, JINGLE_NODE, "action", "session-info")) {
jingle_handle_dtmf(client, pak);
- } else if (iks_find_with_attrib(pak->x, GOOGLE_NODE, "type", "terminate")) {
+ } else if (iks_find_with_attrib(pak->x, JINGLE_NODE, "type", "terminate")) {
jingle_hangup_farend(client, pak);
- } else if (iks_find_with_attrib(pak->x, GOOGLE_NODE, "type", "reject")) {
+ } else if (iks_find_with_attrib(pak->x, JINGLE_NODE, "type", "reject")) {
jingle_hangup_farend(client, pak);
}
ASTOBJ_UNREF(client, jingle_member_destroy);
More information about the asterisk-commits
mailing list