[sipxtapi] r1425 committed - Applied patch from Saab:...

3 views
Skip to first unread message

codesite...@google.com

unread,
Feb 7, 2011, 5:35:54 PM2/7/11
to sipxtapi...@googlegroups.com
Revision: 1425
Author: jaroslavl1
Date: Mon Feb 7 14:33:13 2011
Log: Applied patch from Saab:

SipLineMgr:
- When deleting a line from the line manager, we often saw that messages
was not completely cleaned up in the refresh manager for that user.
deleteLine now calls the new method deleteUser in RefreshMgr.

SipRefreshManager:
- Added deleteUser method that would make sure all messages for a given
fromUrl would be deleted and not rescheduled.
- In unRegisterUser, set sipMsg.allowContactOverride(FALSE) is
prepareContact would otherwise override the contact field and destroy the
expires field.

http://code.google.com/p/sipxtapi/source/detail?r=1425

Modified:
/trunk/sipXtackLib/include/net/SipRefreshMgr.h
/trunk/sipXtackLib/src/net/SipLineMgr.cpp
/trunk/sipXtackLib/src/net/SipRefreshMgr.cpp

=======================================
--- /trunk/sipXtackLib/include/net/SipRefreshMgr.h Sun Jan 24 03:43:15 2010
+++ /trunk/sipXtackLib/include/net/SipRefreshMgr.h Mon Feb 7 14:33:13 2011
@@ -73,6 +73,7 @@
void reRegister(const Url& fromUrl);

void unRegisterUser(const Url& fromUrl);
+ void deleteUser(const Url& fromUrl);

void setLineMgr(SipLineMgr* lineMgr);

=======================================
--- /trunk/sipXtackLib/src/net/SipLineMgr.cpp Mon Feb 7 14:17:41 2011
+++ /trunk/sipXtackLib/src/net/SipLineMgr.cpp Mon Feb 7 14:33:13 2011
@@ -104,14 +104,33 @@

UtlBoolean SipLineMgr::deleteLine(const Url& lineUri)
{
- OsLock lock(m_mutex);
-
- if (m_listList.remove(lineUri))
- {
- syslog(FAC_LINE_MGR, PRI_INFO, "SipLineMgr::deleteLine deleted
line: %s",
+ Url fullLineUrl;
+ {
+ OsLock lock(m_mutex);
+
+ SipLine *pLine = m_listList.getLine(lineUri);
+ if (!pLine)
+ {
+ syslog(FAC_LINE_MGR, PRI_ERR, "SipLineMgr::deleteLine unable to
delete line (not found): %s",
lineUri.toString().data());
-
- return TRUE;
+ return FALSE;
+ }
+
+ fullLineUrl = pLine->getFullLineUrl();
+ pLine = NULL;
+
+ if (m_listList.remove(lineUri))
+ {
+ syslog(FAC_LINE_MGR, PRI_INFO, "SipLineMgr::deleteLine deleted
line: %s",
+ lineUri.toString().data());
+
+ if(fullLineUrl.isNull() == FALSE)
+ {
+ m_pRefreshMgr->deleteUser(fullLineUrl);
+ }
+
+ return TRUE;
+ }
}

return FALSE;
=======================================
--- /trunk/sipXtackLib/src/net/SipRefreshMgr.cpp Mon Feb 7 14:27:39 2011
+++ /trunk/sipXtackLib/src/net/SipRefreshMgr.cpp Mon Feb 7 14:33:13 2011
@@ -187,6 +187,34 @@
addToRegisterList(&sipMsg);
}
}
+
+void SipRefreshMgr::deleteUser(const Url& fromUrl)
+{
+ SipMessage sipMsg;
+ if (isDuplicateRegister(fromUrl, sipMsg))
+ {
+ //dont set a common expires - then you need to send * in contact field
+ //sipMsg.setExpiresField(0);
+ UtlString contactField;
+ sipMsg.getContactField(0,contactField);
+ Url contact(contactField);
+ contact.setFieldParameter(SIP_EXPIRES_FIELD,"0");
+ sipMsg.setContactField(contact.toString());
+ sipMsg.removeHeader(SIP_EXPIRES_FIELD,0);
+ // Don't let prepareContact override the contact field - that will
destroy the expires filed parameter
+ sipMsg.allowContactOverride(FALSE);
+
+ Url lineUri = SipLine::getLineUri(fromUrl);
+
+ if (m_pLineListener)
+ {
+
m_pLineListener->OnLineUnregistering(SipLineStateEvent(lineUri.toString(),
SIPXTACK_LINESTATE_UNREGISTERING_NORMAL));
+ }
+
+ // clear out any pending register requests
+ removeAllFromRequestList(&sipMsg);
+ }
+}

UtlBoolean SipRefreshMgr::isDuplicateRegister(const Url& fromUrl,
SipMessage &oldMsg)

Reply all
Reply to author
Forward
0 new messages