From fd87e1d61acce70846fa924ff2f192edab87ccf6 Mon Sep 17 00:00:00 2001
From: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
Date: Tue, 2 Oct 2007 16:05:01 -0400
Subject: [PATCH] IAX: Fix new registration when account updated.

---
 src/iaxvoiplink.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/iaxvoiplink.cpp b/src/iaxvoiplink.cpp
index a2923f15d9..fbac29a1de 100644
--- a/src/iaxvoiplink.cpp
+++ b/src/iaxvoiplink.cpp
@@ -397,12 +397,15 @@ IAXVoIPLink::sendRegister()
   // lock
   _mutexIAX.enterMutex();
 
-  if (_regSession == NULL) {
-    _regSession = iax_session_new();
+  // Always use a brand new session
+  if (_regSession) {
+    iax_destroy(_regSession);
   }
+
+  _regSession = iax_session_new();
+
   if (!_regSession) {
     _debug("Error when generating new session for register");
-
   } else {
     // refresh
     // last reg
-- 
GitLab