[asterisk-commits] dbrooks: branch dbrooks/jinglegtalkwork r179459 - /team/dbrooks/jinglegtalkwo...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 2 16:13:04 CST 2009
Author: dbrooks
Date: Mon Mar 2 16:12:24 2009
New Revision: 179459
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179459
Log:
Just getting rid of extraneous whitespace
Modified:
team/dbrooks/jinglegtalkwork/channels/chan_gtalk.c
Modified: team/dbrooks/jinglegtalkwork/channels/chan_gtalk.c
URL: http://svn.digium.com/svn-view/asterisk/team/dbrooks/jinglegtalkwork/channels/chan_gtalk.c?view=diff&rev=179459&r1=179458&r2=179459
==============================================================================
--- team/dbrooks/jinglegtalkwork/channels/chan_gtalk.c (original)
+++ team/dbrooks/jinglegtalkwork/channels/chan_gtalk.c Mon Mar 2 16:12:24 2009
@@ -238,12 +238,12 @@
get_codec: gtalk_get_codec,
};
-static char show_channels_usage[] =
-"Usage: gtalk show channels\n"
+static char show_channels_usage[] =
+"Usage: gtalk show channels\n"
" Shows current state of the Gtalk channels.\n";
-static char reload_usage[] =
-"Usage: gtalk reload\n"
+static char reload_usage[] =
+"Usage: gtalk reload\n"
" Reload gtalk channel driver.\n";
@@ -304,7 +304,7 @@
iks *payload_eg711u, *payload_pcmu;
payload_pcmu = iks_new("payload-type");
payload_eg711u = iks_new("payload-type");
-
+
if(!payload_eg711u || !payload_pcmu) {
if(payload_pcmu)
iks_delete(payload_pcmu);
@@ -447,7 +447,7 @@
codecs_num = add_codec_to_answer(p, pref_codec, dcodecs);
alreadysent |= pref_codec;
}
-
+
if (codecs_num) {
/* only propose DTMF within an audio session */
iks_insert_attrib(payload_telephone, "id", "106");
@@ -455,7 +455,7 @@
iks_insert_attrib(payload_telephone, "clockrate", "8000");
}
iks_insert_attrib(transport,"xmlns","http://www.google.com/transport/p2p");
-
+
iks_insert_attrib(iq, "type", "set");
iks_insert_attrib(iq, "to", to);
iks_insert_attrib(iq, "from", from);
@@ -548,7 +548,7 @@
{
struct gtalk_pvt *p = ast->tech_pvt;
int res = 0;
-
+
if (option_debug)
ast_log(LOG_DEBUG, "Answer!\n");
ast_mutex_lock(&p->lock);
@@ -655,10 +655,10 @@
ast_rtp_set_rtpmap_type(tmp->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
codec = iks_next_tag(codec);
}
-
+
/* Now gather all of the codecs that we are asked for */
ast_rtp_get_current_formats(tmp->rtp, &tmp->peercapability, &peernoncodeccapability);
-
+
/* at this point, we received an awser from the remote Gtalk client,
which allows us to compare capabilities */
tmp->jointcapability = tmp->capability & tmp->peercapability;
@@ -672,7 +672,7 @@
return -1;
}
-
+
from = iks_find_attrib(pak->x, "to");
if(!from)
from = client->connection->jid->full;
@@ -1184,7 +1184,7 @@
from = iks_find_attrib(pak->x,"to");
if(!from)
from = client->connection->jid->full;
-
+
while (tmp) {
if (iks_find_with_attrib(pak->x, "session", "id", tmp->sid)) {
ast_log(LOG_NOTICE, "Ignoring duplicate call setup on SID %s\n", tmp->sid);
@@ -1194,15 +1194,15 @@
tmp = tmp->next;
}
- if (!strcasecmp(client->name, "guest")){
- /* the guest account is not tied to any configured XMPP client,
- let's set it now */
- client->connection = ast_aji_get_client(from);
- if (!client->connection) {
- ast_log(LOG_ERROR, "No XMPP client to talk to, us (partial JID) : %s\n", from);
- return -1;
- }
- }
+ if (!strcasecmp(client->name, "guest")){
+ /* the guest account is not tied to any configured XMPP client,
+ let's set it now */
+ client->connection = ast_aji_get_client(from);
+ if (!client->connection) {
+ ast_log(LOG_ERROR, "No XMPP client to talk to, us (partial JID) : %s\n", from);
+ return -1;
+ }
+ }
p = gtalk_alloc(client, from, pak->from->full, iks_find_attrib(pak->query, "id"));
if (!p) {
@@ -1223,20 +1223,20 @@
sizeof(p->sid));
}
- /* codec points to the first <payload-type/> tag */
+ /* codec points to the first <payload-type/> tag */
codec = iks_first_tag(iks_first_tag(iks_first_tag(pak->x)));
-
+
while (codec) {
ast_rtp_set_m_type(p->rtp, atoi(iks_find_attrib(codec, "id")));
ast_rtp_set_rtpmap_type(p->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
codec = iks_next_tag(codec);
}
-
+
/* Now gather all of the codecs that we are asked for */
ast_rtp_get_current_formats(p->rtp, &p->peercapability, &peernoncodeccapability);
p->jointcapability = p->capability & p->peercapability;
ast_mutex_unlock(&p->lock);
-
+
ast_setstate(chan, AST_STATE_RING);
if (!p->jointcapability) {
ast_log(LOG_WARNING, "Capabilities don't match : us - %s, peer - %s, combined - %s \n", ast_getformatname_multiple(s1, BUFSIZ, p->capability),
@@ -1248,10 +1248,10 @@
gtalk_hangup(chan);
ast_channel_free(chan);
return -1;
- }
+ }
res = ast_pbx_start(chan);
-
+
switch (res) {
case AST_PBX_FAILED:
ast_log(LOG_WARNING, "Failed to start PBX :(\n");
@@ -1295,19 +1295,19 @@
sin.sin_port = htons(tmp->port);
snprintf(username, sizeof(username), "%s%s", tmp->username,
p->ourcandidates->username);
-
+
/* Find out the result of the STUN */
ast_rtp_get_peer(p->rtp, &aux);
/* If the STUN result is different from the IP of the hostname,
lock on the stun IP of the hostname advertised by the
remote client */
- if (aux.sin_addr.s_addr &&
+ if (aux.sin_addr.s_addr &&
aux.sin_addr.s_addr != sin.sin_addr.s_addr)
ast_rtp_stun_request(p->rtp, &aux, username);
- else
+ else
ast_rtp_stun_request(p->rtp, &sin, username);
-
+
if (aux.sin_addr.s_addr && option_debug > 3) {
ast_log(LOG_DEBUG, "Receiving RTP traffic from IP %s, matches with remote candidate's IP %s\n", ast_inet_ntoa(aux.sin_addr), tmp->ip);
ast_log(LOG_DEBUG, "Sending STUN request to %s\n", tmp->ip);
@@ -1368,7 +1368,7 @@
newcandidate->protocol = AJI_PROTOCOL_UDP;
if (!strcasecmp(iks_find_attrib(traversenodes, "protocol"), "ssltcp"))
newcandidate->protocol = AJI_PROTOCOL_SSLTCP;
-
+
if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "stun"))
newcandidate->type = AJI_CONNECT_STUN;
if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "local"))
@@ -1379,7 +1379,7 @@
sizeof(newcandidate->network));
newcandidate->generation = atoi(iks_find_attrib(traversenodes, "generation"));
newcandidate->next = NULL;
-
+
newcandidate->next = p->theircandidates;
p->theircandidates = newcandidate;
p->laststun = 0;
@@ -1388,7 +1388,7 @@
}
traversenodes = iks_next_tag(traversenodes);
}
-
+
receipt = iks_new("iq");
iks_insert_attrib(receipt, "type", "result");
iks_insert_attrib(receipt, "from", from);
@@ -1610,7 +1610,7 @@
*/
/*! \brief Initiate new call, part of PBX interface
- * dest is the dial string */
+ *dest is the dial string */
static int gtalk_call(struct ast_channel *ast, char *dest, int timeout)
{
struct gtalk_pvt *p = ast->tech_pvt;
@@ -1731,14 +1731,14 @@
resource ++;
}
if (chan)
- ast_cli(fd, FORMAT,
+ ast_cli(fd, FORMAT,
chan->name,
jid,
resource,
ast_getformatname(chan->readformat),
- ast_getformatname(chan->writeformat)
+ ast_getformatname(chan->writeformat)
);
- else
+ else
ast_log(LOG_WARNING, "No available channel\n");
numchans ++;
p = p->next;
@@ -1874,8 +1874,8 @@
else if (!strcasecmp(var->name, "connection")) {
if ((client = ast_aji_get_client(var->value))) {
member->connection = client;
- iks_filter_add_rule(client->f, gtalk_parser, member,
- IKS_RULE_TYPE, IKS_PAK_IQ,
+ iks_filter_add_rule(client->f, gtalk_parser, member,
+ IKS_RULE_TYPE, IKS_PAK_IQ,
IKS_RULE_FROM_PARTIAL, member->user,
IKS_RULE_NS, "http://www.google.com/session",
IKS_RULE_DONE);
@@ -2041,11 +2041,11 @@
}
sched = sched_context_create();
- if (!sched)
+ if (!sched)
ast_log(LOG_WARNING, "Unable to create schedule context\n");
io = io_context_create();
- if (!io)
+ if (!io)
ast_log(LOG_WARNING, "Unable to create I/O context\n");
if (ast_find_ourip(&__ourip, bindaddr)) {
More information about the asterisk-commits
mailing list