Index: chan_jingle.c =================================================================== --- chan_jingle.c (revision 42947) +++ chan_jingle.c (working copy) @@ -21,12 +21,13 @@ * \author Matt O'Gorman * * \brief Jingle Channel Driver - * + * * \ingroup channel_drivers */ /*** MODULEINFO iksemel + ***/ #include "asterisk.h" @@ -707,8 +708,9 @@ buddy = ASTOBJ_CONTAINER_FIND(&client->connection->buddies, from); if (buddy) resources = buddy->resources; - } else + } else if (client->buddy) { resources = client->buddy->resources; + } while (resources) { if (resources->cap->jingle) { break; @@ -935,7 +937,7 @@ iks_find_attrib(codec, "name"), 0); codec = iks_next(codec); } - + ast_mutex_unlock(&p->lock); ast_setstate(chan, AST_STATE_RING); res = ast_pbx_start(chan); @@ -1033,7 +1035,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")) @@ -1044,7 +1046,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; @@ -1053,7 +1055,7 @@ } traversenodes = iks_next(traversenodes); } - + receipt = iks_new("iq"); iks_insert_attrib(receipt, "type", "result"); iks_insert_attrib(receipt, "from", c->jid->full); @@ -1304,7 +1306,7 @@ } */ -/*! \brief Initiate new call, part of PBX interface +/*! \brief Initiate new call, part of PBX interface * dest is the dial string */ static int jingle_call(struct ast_channel *ast, char *dest, int timeout) { @@ -1445,7 +1447,7 @@ ASTOBJ_UNREF(client, jingle_member_destroy); return IKS_FILTER_EAT; } -/* Not using this anymore probably take out soon +/* Not using this anymore probably take out soon static struct jingle_candidate *jingle_create_candidate(char *args) { char *name, *type, *preference, *protocol; @@ -1672,11 +1674,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)) {