[asterisk-commits] file: trunk r51801 - in /trunk: ./ channels/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Jan 23 15:59:56 MST 2007
Author: file
Date: Tue Jan 23 16:59:55 2007
New Revision: 51801
URL: http://svn.digium.com/view/asterisk?view=rev&rev=51801
Log:
Merged revisions 51788 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r51788 | file | 2007-01-23 17:46:31 -0500 (Tue, 23 Jan 2007) | 2 lines
Update channel drivers to use module referencing so that unloading them while in use will not result in crashes. (issue #8897 reported by junky)
........
Modified:
trunk/ (props changed)
trunk/channels/chan_alsa.c
trunk/channels/chan_features.c
trunk/channels/chan_gtalk.c
trunk/channels/chan_iax2.c
trunk/channels/chan_oss.c
trunk/channels/chan_phone.c
trunk/channels/chan_sip.c
trunk/channels/chan_skinny.c
trunk/channels/chan_zap.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_alsa.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_alsa.c (original)
+++ trunk/channels/chan_alsa.c Tue Jan 23 16:59:55 2007
@@ -580,6 +580,7 @@
c->tech_pvt = NULL;
alsa.owner = NULL;
ast_verbose(" << Hangup on console >> \n");
+ ast_module_unref(ast_module_info->self);
if (hookstate) {
hookstate = 0;
if (!autoanswer) {
@@ -805,6 +806,7 @@
if (!ast_strlen_zero(language))
ast_string_field_set(tmp, language, language);
p->owner = tmp;
+ ast_module_ref(ast_module_info->self);
ast_jb_configure(tmp, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
Modified: trunk/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_features.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_features.c (original)
+++ trunk/channels/chan_features.c Tue Jan 23 16:59:55 2007
@@ -490,6 +490,7 @@
p->subs[index].owner = tmp;
if (!p->owner)
p->owner = tmp;
+ ast_module_ref(ast_module_info->self);
return tmp;
}
Modified: trunk/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_gtalk.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_gtalk.c (original)
+++ trunk/channels/chan_gtalk.c Tue Jan 23 16:59:55 2007
@@ -952,6 +952,7 @@
if (!ast_strlen_zero(client->musicclass))
ast_string_field_set(tmp, musicclass, client->musicclass);
i->owner = tmp;
+ ast_module_ref(ast_module_info->self);
ast_copy_string(tmp->context, client->context, sizeof(tmp->context));
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
/* Don't use ast_set_callerid() here because it will
@@ -1464,6 +1465,7 @@
ast_mutex_unlock(&p->lock);
gtalk_free_pvt(client, p);
+ ast_module_unref(ast_module_info->self);
return 0;
}
Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Tue Jan 23 16:59:55 2007
@@ -1772,6 +1772,7 @@
c->tech_pvt = NULL;
ast_queue_hangup(c);
pvt->owner = NULL;
+ ast_module_unref(ast_module_info->self);
}
return 0;
@@ -3402,6 +3403,7 @@
for (v = i->vars ; v ; v = v->next)
pbx_builtin_setvar_helper(tmp, v->name, v->value);
+ ast_module_ref(ast_module_info->self);
return tmp;
}
Modified: trunk/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_oss.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_oss.c (original)
+++ trunk/channels/chan_oss.c Tue Jan 23 16:59:55 2007
@@ -865,6 +865,7 @@
c->tech_pvt = NULL;
o->owner = NULL;
ast_verbose(" << Hangup on console >> \n");
+ ast_module_unref(ast_module_info->self);
if (o->hookstate) {
if (o->autoanswer || o->autohangup) {
/* Assume auto-hangup too */
@@ -1047,6 +1048,7 @@
c->cid.cid_dnid = ast_strdup(ext);
o->owner = c;
+ ast_module_ref(ast_module_info->self);
ast_jb_configure(c, &global_jbconf);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(c)) {
Modified: trunk/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_phone.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_phone.c (original)
+++ trunk/channels/chan_phone.c Tue Jan 23 16:59:55 2007
@@ -385,6 +385,7 @@
p->dialtone = 0;
memset(p->ext, 0, sizeof(p->ext));
((struct phone_pvt *)(ast->tech_pvt))->owner = NULL;
+ ast_module_unref(ast_module_info->self);
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
ast->tech_pvt = NULL;
@@ -907,6 +908,7 @@
tmp->cid.cid_name = ast_strdup(i->cid_name);
i->owner = tmp;
+ ast_module_ref(ast_module_info->self);
if (state != AST_STATE_DOWN) {
if (state == AST_STATE_RING) {
ioctl(tmp->fds[0], PHONE_RINGBACK);
@@ -987,6 +989,7 @@
if (i->mode == MODE_IMMEDIATE) {
phone_new(i, AST_STATE_RING, i->context);
} else if (i->mode == MODE_DIALTONE) {
+ ast_module_ref(ast_module_info->self);
/* Reset the extension */
i->ext[0] = '\0';
/* Play the dialtone */
@@ -996,6 +999,7 @@
ioctl(i->fd, PHONE_PLAY_START);
i->lastformat = -1;
} else if (i->mode == MODE_SIGMA) {
+ ast_module_ref(ast_module_info->self);
/* Reset the extension */
i->ext[0] = '\0';
/* Play the dialtone */
@@ -1003,6 +1007,8 @@
ioctl(i->fd, PHONE_DIALTONE);
}
} else {
+ if (i->dialtone)
+ ast_module_unref(ast_module_info->self);
memset(i->ext, 0, sizeof(i->ext));
if (i->cpt)
{
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Jan 23 16:59:55 2007
@@ -3455,6 +3455,7 @@
p->owner = NULL;
ast->tech_pvt = NULL;
+ ast_module_unref(ast_module_info->self);
/* Do not destroy this pvt until we have timeout or
get an answer to the BYE or INVITE/CANCEL
If we get no answer during retransmit period, drop the call anyway.
@@ -3976,6 +3977,7 @@
if (!ast_strlen_zero(i->language))
ast_string_field_set(tmp, language, i->language);
i->owner = tmp;
+ ast_module_ref(ast_module_info->self);
ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Tue Jan 23 16:59:55 2007
@@ -2753,6 +2753,7 @@
if (l->amaflags)
tmp->amaflags = l->amaflags;
+ ast_module_ref(ast_module_info->self);
tmp->callgroup = l->callgroup;
tmp->pickupgroup = l->pickupgroup;
ast_string_field_set(tmp, call_forward, l->call_forward);
Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=51801&r1=51800&r2=51801
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Tue Jan 23 16:59:55 2007
@@ -2906,6 +2906,7 @@
p->oprmode = 0;
ast->tech_pvt = NULL;
ast_mutex_unlock(&p->lock);
+ ast_module_unref(ast_module_info->self);
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
@@ -5652,6 +5653,7 @@
}
}
+ ast_module_ref(ast_module_info->self);
return tmp;
}
More information about the asterisk-commits
mailing list