aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5c99a2084..2d7b435c6 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -221,8 +221,6 @@ static struct ast_jb_conf global_jbconf;
static const char config[] = "sip.conf";
static const char notify_config[] = "sip_notify.conf";
-static int usecnt = 0;
-
#define RTP 1
#define NO_RTP 0
@@ -3324,8 +3322,7 @@ static int sip_hangup(struct ast_channel *ast)
p->owner = NULL;
ast->tech_pvt = NULL;
- ast_atomic_fetchadd_int(&usecnt, -1);
- ast_update_use_count();
+ 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
@@ -3852,8 +3849,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
if (!ast_strlen_zero(i->language))
ast_string_field_set(tmp, language, i->language);
i->owner = tmp;
- ast_atomic_fetchadd_int(&usecnt, 1);
- ast_update_use_count();
+ 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));