[svn-commits] mogorman: trunk r39351 - in /trunk:
channels/chan_jingle.c res/res_jabber.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Tue Aug 8 10:07:42 MST 2006
Author: mogorman
Date: Tue Aug 8 12:07:41 2006
New Revision: 39351
URL: http://svn.digium.com/view/asterisk?rev=39351&view=rev
Log:
some code clean up and catch for a act_hook being called
without a packet.
Modified:
trunk/channels/chan_jingle.c
trunk/res/res_jabber.c
Modified: trunk/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_jingle.c?rev=39351&r1=39350&r2=39351&view=diff
==============================================================================
--- trunk/channels/chan_jingle.c (original)
+++ trunk/channels/chan_jingle.c Tue Aug 8 12:07:41 2006
@@ -168,7 +168,7 @@
static int global_capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263;
-AST_MUTEX_DEFINE_STATIC(jinglelock); /*!< Protect the interface list (of sip_pvt's) */
+AST_MUTEX_DEFINE_STATIC(jinglelock); /*!< Protect the interface list (of jingle_pvt's) */
/* Forward declarations */
static struct ast_channel *jingle_request(const char *type, int format, void *data, int *cause);
@@ -448,7 +448,7 @@
static int jingle_response(struct jingle *client, ikspak *pak, const char *reasonstr, const char *reasonstr2)
{
- iks *response, *error = NULL, *reason;
+ iks *response = NULL, *error = NULL, *reason = NULL;
int res = -1;
response = iks_new("iq");
@@ -1238,8 +1238,8 @@
}
static int jingle_transmit_invite(struct jingle_pvt *p)
{
- struct jingle *jingle;
- struct aji_client *client;
+ struct jingle *jingle = NULL;
+ struct aji_client *client = NULL;
iks *iq, *desc, *session;
iks *payload_eg711u, *payload_pcmu;
@@ -1577,7 +1577,8 @@
ast_copy_string(context, var->value, sizeof(context));
else if (!strcasecmp(var->name, "externip"))
ast_copy_string(externip, var->value, sizeof(externip));
-#if 0
+/* Idea to allow for custom candidates */
+/*
else if (!strcasecmp(var->name, "candidate")) {
candidate = jingle_create_candidate(var->value);
if (candidate) {
@@ -1585,7 +1586,7 @@
global_candidates = candidate;
}
}
-#endif
+*/
}
while (cat) {
if (strcasecmp(cat, "general")) {
@@ -1610,7 +1611,8 @@
else if (!strcasecmp(var->name, "context"))
ast_copy_string(member->context, var->value,
sizeof(member->context));
-#if 0
+/* Idea to allow for custom candidates */
+/*
else if (!strcasecmp(var->name, "candidate")) {
candidate = jingle_create_candidate(var->value);
if (candidate) {
@@ -1618,7 +1620,7 @@
member->ourcandidates = candidate;
}
}
-#endif
+*/
var = var->next;
}
ASTOBJ_UNLOCK(member);
Modified: trunk/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_jabber.c?rev=39351&r1=39350&r2=39351&view=diff
==============================================================================
--- trunk/res/res_jabber.c (original)
+++ trunk/res/res_jabber.c Tue Aug 8 12:07:41 2006
@@ -127,7 +127,7 @@
static char *ajisend_synopsis = "JabberSend(jabber,screenname,message)";
static char *ajisend_descrip =
-"JabberRSend(Jabber,ScreenName,Message)\n"
+"JabberSend(Jabber,ScreenName,Message)\n"
" Jabber - Client or transport Asterisk uses to connect to Jabber\n"
" ScreenName - User Name to message.\n"
" Message - Message to be sent to the buddy\n";
@@ -443,6 +443,11 @@
struct aji_client *client = ASTOBJ_REF((struct aji_client *) data);
ikspak *pak = NULL;
iks *auth = NULL;
+
+ if(!node) {
+ ast_log(LOG_ERROR, "aji_act_hook was called with out a packet\n"); /* most likely cause type is IKS_NODE_ERROR lost connection */
+ return IKS_HOOK;
+ }
pak = iks_packet(node);
@@ -1003,8 +1008,7 @@
*/
static void aji_handle_iq(struct aji_client *client, iks *node)
{
- if (option_verbose > 4)
- ast_verbose("MWAHHAHAHA NOTHING TO SEE HERE!\n");
+ /*Nothing to see here */
}
/*!
@@ -1908,7 +1912,7 @@
return RESULT_FAILURE;
}
- /* XXX Does Matt really want everyone to use his personal address for tests? */
+ /* XXX Does Matt really want everyone to use his personal address for tests? */ /* XXX yes he does */
ast_aji_send(client, "mogorman at astjab.org", "blahblah");
ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
ASTOBJ_RDLOCK(iterator);
More information about the svn-commits
mailing list