Return pending and outgoing events of all transactions before trying to create new ones.
git-svn-id: http://voip.null.ro/svn/yate@1515 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
9ad1d5fa28
commit
7366b0ff87
|
@ -260,7 +260,18 @@ SIPEvent* SIPEngine::getEvent()
|
||||||
for (; l; l = l->next()) {
|
for (; l; l = l->next()) {
|
||||||
SIPTransaction* t = static_cast<SIPTransaction*>(l->get());
|
SIPTransaction* t = static_cast<SIPTransaction*>(l->get());
|
||||||
if (t) {
|
if (t) {
|
||||||
SIPEvent* e = t->getEvent();
|
SIPEvent* e = t->getEvent(true);
|
||||||
|
if (e) {
|
||||||
|
DDebug(this,DebugInfo,"Got pending event %p (state %s) from transaction %p [%p]",
|
||||||
|
e,SIPTransaction::stateName(e->getState()),t,this);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (l = &TransList; l; l = l->next()) {
|
||||||
|
SIPTransaction* t = static_cast<SIPTransaction*>(l->get());
|
||||||
|
if (t) {
|
||||||
|
SIPEvent* e = t->getEvent(false);
|
||||||
if (e) {
|
if (e) {
|
||||||
DDebug(this,DebugInfo,"Got event %p (state %s) from transaction %p [%p]",
|
DDebug(this,DebugInfo,"Got event %p (state %s) from transaction %p [%p]",
|
||||||
e,SIPTransaction::stateName(e->getState()),t,this);
|
e,SIPTransaction::stateName(e->getState()),t,this);
|
||||||
|
|
|
@ -242,7 +242,7 @@ void SIPTransaction::setTimeout(u_int64_t delay, unsigned int count)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SIPEvent* SIPTransaction::getEvent()
|
SIPEvent* SIPTransaction::getEvent(bool pendingOnly)
|
||||||
{
|
{
|
||||||
SIPEvent *e = 0;
|
SIPEvent *e = 0;
|
||||||
|
|
||||||
|
@ -257,6 +257,9 @@ SIPEvent* SIPTransaction::getEvent()
|
||||||
return new SIPEvent(m_lastMessage ? m_lastMessage : m_firstMessage,this);
|
return new SIPEvent(m_lastMessage ? m_lastMessage : m_firstMessage,this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pendingOnly)
|
||||||
|
return 0;
|
||||||
|
|
||||||
int timeout = -1;
|
int timeout = -1;
|
||||||
if (m_timeout && (Time::now() >= m_timeout)) {
|
if (m_timeout && (Time::now() >= m_timeout)) {
|
||||||
timeout = --m_timeouts;
|
timeout = --m_timeouts;
|
||||||
|
|
|
@ -673,9 +673,10 @@ public:
|
||||||
* It provides default handling for invalid states, otherwise calls
|
* It provides default handling for invalid states, otherwise calls
|
||||||
* the more specific protected version.
|
* the more specific protected version.
|
||||||
* You may override this method if you need processing of invalid states.
|
* You may override this method if you need processing of invalid states.
|
||||||
|
* @param pendingOnly True to only return outgoing and pending events
|
||||||
* @return A newly allocated event or NULL if none is needed
|
* @return A newly allocated event or NULL if none is needed
|
||||||
*/
|
*/
|
||||||
virtual SIPEvent* getEvent();
|
virtual SIPEvent* getEvent(bool pendingOnly = false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and transmits a final response message
|
* Creates and transmits a final response message
|
||||||
|
|
Loading…
Reference in New Issue