[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Wed Sep 22 09:06:09 CDT 2010
branch "master" has been updated
via f760855948a7da1eb2e035d6785c9aad069709b5 (commit)
via eb441ba24be50f78a12d2584c7a6d4a5d8c816a5 (commit)
from 1ac6c37311cae4c867170448ba66a62278a2c9aa (commit)
Summary of changes:
src/SipStateReplicatorListener.cpp | 64 +++++++++++++++++++++++++++++++++---
1 files changed, 59 insertions(+), 5 deletions(-)
- Log -----------------------------------------------------------------
commit f760855948a7da1eb2e035d6785c9aad069709b5
Author: Joshua Colp <jcolp at digium.com>
Date: Wed Sep 22 11:09:21 2010 -0300
Finish up current remaining invite session state item todos.
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index 7fdb727..3f5236d 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -168,16 +168,47 @@ public:
continue;
}
localInviteSession->role = localDialog->role;
+
+ i->second->getSession()->setInviteSession(localInviteSession);
}
- // TODO: Change state
+ if (invitesession->mCurrentState == InviteSessionStateNull)
+ {
+ localInviteSession->state = PJSIP_INV_STATE_NULL;
+ }
+ else if (invitesession->mCurrentState == InviteSessionStateCalling)
+ {
+ localInviteSession->state = PJSIP_INV_STATE_CALLING;
+ }
+ else if (invitesession->mCurrentState == InviteSessionStateIncoming)
+ {
+ localInviteSession->state = PJSIP_INV_STATE_INCOMING;
+ }
+ else if (invitesession->mCurrentState == InviteSessionStateEarly)
+ {
+ localInviteSession->state = PJSIP_INV_STATE_EARLY;
+ }
+ else if (invitesession->mCurrentState == InviteSessionStateConnecting)
+ {
+ localInviteSession->state = PJSIP_INV_STATE_CONNECTING;
+ }
+ else if (invitesession->mCurrentState == InviteSessionStateConfirmed)
+ {
+ localInviteSession->state = PJSIP_INV_STATE_CONFIRMED;
+ }
+ else if (invitesession->mCurrentState == InviteSessionStateDisconnected)
+ {
+ localInviteSession->state = PJSIP_INV_STATE_DISCONNECTED;
+ }
localInviteSession->cancelling = (invitesession->mCancelling == true) ? PJ_TRUE : PJ_FALSE;
localInviteSession->pending_cancel = (invitesession->mPendingCancel == true) ? PJ_TRUE : PJ_FALSE;
+ localInviteSession->cause = (pjsip_status_code) invitesession->mCause;
- // TODO: Set cause
-
- // TODO: Set cause text
+ if (!invitesession->mCauseText.empty())
+ {
+ pj_strdup2(localInviteSession->pool, &localInviteSession->cause_text, invitesession->mCauseText.c_str());
+ }
localInviteSession->notify = (invitesession->mNotify == true) ? PJ_TRUE : PJ_FALSE;
localInviteSession->last_ack_cseq = invitesession->mLastAckCseq;
commit eb441ba24be50f78a12d2584c7a6d4a5d8c816a5
Author: Joshua Colp <jcolp at digium.com>
Date: Wed Sep 22 11:03:17 2010 -0300
Add beginning of invite session state item handling.
diff --git a/src/SipStateReplicatorListener.cpp b/src/SipStateReplicatorListener.cpp
index ab9d25b..7fdb727 100644
--- a/src/SipStateReplicatorListener.cpp
+++ b/src/SipStateReplicatorListener.cpp
@@ -151,20 +151,43 @@ public:
}
else if ((invitesession = SipInviteSessionStateItemPtr::dynamicCast((*item))))
{
- // This check also needs to look for the dialog
- if (i == mStateItems.end())
+ if (i == mStateItems.end() || !i->second->getSession() || !i->second->getSession()->getDialog())
{
continue;
}
+
+ pjsip_dialog *localDialog = i->second->getSession()->getDialog();
+ pjsip_inv_session *localInviteSession = i->second->getSession()->getInviteSession();
+
+ if (!localInviteSession)
+ {
+ // Like dialogs we always start out an invite session as UAC and transition it
+ if ((pjsip_inv_create_uac(localDialog, NULL, 0, &localInviteSession)) != PJ_SUCCESS)
+ {
+ // Something went really wrong...
+ continue;
+ }
+ localInviteSession->role = localDialog->role;
+ }
+
+ // TODO: Change state
+
+ localInviteSession->cancelling = (invitesession->mCancelling == true) ? PJ_TRUE : PJ_FALSE;
+ localInviteSession->pending_cancel = (invitesession->mPendingCancel == true) ? PJ_TRUE : PJ_FALSE;
+
+ // TODO: Set cause
+
+ // TODO: Set cause text
+
+ localInviteSession->notify = (invitesession->mNotify == true) ? PJ_TRUE : PJ_FALSE;
+ localInviteSession->last_ack_cseq = invitesession->mLastAckCseq;
}
else if ((transaction = SipTransactionStateItemPtr::dynamicCast((*item))))
{
- // This check also needs to look for the dialog and invite session
- if (i == mStateItems.end())
+ if (i == mStateItems.end() || !i->second->getSession() || !i->second->getSession()->getInviteSession())
{
continue;
}
- localitem = i->second;
}
}
}
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list