[asterisk-commits] branch group/asterisk-xmpp r26095 -
/team/group/asterisk-xmpp/channels/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue May 9 07:45:47 MST 2006
Author: russell
Date: Tue May 9 09:45:46 2006
New Revision: 26095
URL: http://svn.digium.com/view/asterisk?rev=26095&view=rev
Log:
- register/unregister the jingle rtp protocol struct
- make chan_jingle compile more cleanly
Modified:
team/group/asterisk-xmpp/channels/chan_jingle.c
Modified: team/group/asterisk-xmpp/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-xmpp/channels/chan_jingle.c?rev=26095&r1=26094&r2=26095&view=diff
==============================================================================
--- team/group/asterisk-xmpp/channels/chan_jingle.c (original)
+++ team/group/asterisk-xmpp/channels/chan_jingle.c Tue May 9 09:45:46 2006
@@ -1148,29 +1148,23 @@
static int jingle_indicate(struct ast_channel *ast, int condition)
{
- struct jingle_pvt *p = ast->tech_pvt;
- int res = -1;
ast_log(LOG_NOTICE, "XXX Implement jingle indicate XXX\n");
- return res;
+
+ return -1;
}
static int jingle_digit(struct ast_channel *ast, char digit)
{
- struct jingle_pvt *p = ast->tech_pvt;
- int res = -1;
-
ast_log(LOG_NOTICE, "XXX Implement jingle digit XXX\n");
- return res;
-}
-
-static int jingle_sendhtml(struct ast_channel *ast, int subclass, const char *data,
- int datalen)
-{
- struct jingle_pvt *p = ast->tech_pvt;
- int res = -1;
-
+
+ return -1;
+}
+
+static int jingle_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen)
+{
ast_log(LOG_NOTICE, "XXX Implement jingle sendhtml XXX\n");
- return res;
+
+ return -1;
}
static int jingle_transmit_invite(struct jingle_pvt *p)
{
@@ -1235,13 +1229,6 @@
static int jingle_call(struct ast_channel *ast, char *dest, int timeout)
{
struct jingle_pvt *p = ast->tech_pvt;
- struct varshead *headp;
- struct ast_var_t *current;
- size_t len, namelen;
-
- ast_verbose("Welcome to disneyland! %s %d\n", dest, timeout);
-
- p = ast->tech_pvt;
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
ast_log(LOG_WARNING, "jingle_call called on %s, neither down nor reserved\n", ast->name);
@@ -1252,14 +1239,14 @@
p->jointcapability = p->capability;
if (!p->ringrule) {
ast_copy_string(p->ring, p->parent->connection->mid, sizeof(p->ring));
- p->ringrule =
- iks_filter_add_rule(p->parent->connection->f, jingle_ringing_ack, p,
- IKS_RULE_ID, p->ring, IKS_RULE_DONE);
+ p->ringrule = iks_filter_add_rule(p->parent->connection->f, jingle_ringing_ack, p,
+ IKS_RULE_ID, p->ring, IKS_RULE_DONE);
} else {
ast_log(LOG_WARNING, "Whoa, already have a ring rule!\n");
}
jingle_transmit_invite(p);
jingle_create_candidates(p->parent, p, p->sid, p->from);
+
return 0;
}
@@ -1267,30 +1254,21 @@
static int jingle_hangup(struct ast_channel *ast)
{
struct jingle_pvt *p = ast->tech_pvt;
- struct jingle *peer = NULL;
- struct jingle *client = NULL;
- int isoutbound;
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
- struct jingle_pvt *cur, *prev = NULL;
- struct ast_channel *ochan = NULL;
- int glaredetect;
- const char *status;
-
-
- ast_verbose("what caused this!\n");
+ struct jingle *client;
+
ast_mutex_lock(&p->lock);
client = p->parent;
p->owner = NULL;
ast->tech_pvt = NULL;
- if (!p->alreadygone) {
+ if (!p->alreadygone)
jingle_action(client, p, "terminate");
- }
ast_mutex_unlock(&p->lock);
jingle_free_pvt(client, p);
ast_mutex_lock(&usecnt_lock);
usecnt--;
ast_mutex_unlock(&usecnt_lock);
+
return 0;
}
@@ -1517,7 +1495,6 @@
cat = ast_category_browse(cfg, NULL);
for (var = ast_variable_browse(cfg, "general"); var; var = var->next) {
- struct jingle_candidate *candidate = NULL;
if (!strcasecmp(var->name, "allowguest"))
allowguest =
(ast_true(ast_variable_retrieve(cfg, "general", "allowguest"))) ? 1 : 0;
@@ -1540,7 +1517,6 @@
#endif
}
while (cat) {
- struct jingle_candidate *candidate = NULL;
if (strcasecmp(cat, "general")) {
var = ast_variable_browse(cfg, cat);
member = (struct jingle *) malloc(sizeof(struct jingle));
@@ -1638,6 +1614,8 @@
return 0;
}
+ ast_rtp_proto_register(&jingle_rtp);
+
/* Make sure we can register our channel type */
if (ast_channel_register(&jingle_tech)) {
ast_log(LOG_ERROR, "Unable to register channel class %s\n", type);
@@ -1648,7 +1626,7 @@
}
/*! \brief Reload module */
-static int reload(void)
+static int reload(void *mod)
{
return 0;
}
@@ -1662,6 +1640,7 @@
/* First, take us out of the channel loop */
// ast_cli_unregister(&cli_show_xmpps);
ast_channel_unregister(&jingle_tech);
+ ast_rtp_proto_unregister(&jingle_rtp);
if (!ast_mutex_lock(&jinglelock)) {
/* Hangup all interfaces if they have an owner */
// p = jingles->p;
@@ -1679,11 +1658,6 @@
return 0;
}
-int usecount(void)
-{
- return usecnt;
-}
-
static const char *key(void)
{
return ASTERISK_GPL_KEY;
More information about the asterisk-commits
mailing list