[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
Tue Aug 24 07:42:12 CDT 2010
branch "master" has been updated
via 79e0410bf6ed60383bee6c334b350fa40afde92e (commit)
via 74e77a621aeef2f2ce3bbf87b01806ae17434955 (commit)
via f7f20e58b87d99afa50bbdb0032f2e5d35b96486 (commit)
from dcf0b5d8b4fff256a82b30fabec88d1ab9a1c0f4 (commit)
Summary of changes:
src/SipChannelServiceEndpointLocator.cpp | 1 +
src/SipEndpoint.cpp | 51 +++++++++++++++++++++++++-----
src/SipEndpoint.h | 18 ++++++++++-
src/SipEndpointFactory.cpp | 7 ++++
src/SipEndpointFactory.h | 4 ++-
5 files changed, 71 insertions(+), 10 deletions(-)
- Log -----------------------------------------------------------------
commit 79e0410bf6ed60383bee6c334b350fa40afde92e
Author: Joshua Colp <jcolp at digium.com>
Date: Tue Aug 24 09:47:16 2010 -0300
Add skeleton for media session and provide a proxy to it.
diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index 85072d5..a1384a3 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -1,4 +1,5 @@
#include <Ice/Ice.h>
+#include <IceUtil/UUID.h>
#include "SipEndpoint.h"
@@ -115,6 +116,35 @@ public:
}
};
+class SipMediaSession : public Media::V1::Session
+{
+public:
+SipMediaSession() : mId(IceUtil::generateUUID()) { };
+
+ Hydra::Media::V1::StreamSourceSeq getSources(const Ice::Current&)
+ {
+ Hydra::Media::V1::StreamSourceSeq sources;
+ return sources;
+ }
+
+ Hydra::Media::V1::StreamSinkSeq getSinks(const Ice::Current&)
+ {
+ Hydra::Media::V1::StreamSinkSeq sinks;
+ return sinks;
+ }
+
+ virtual std::string getId(const Ice::Current&)
+ {
+ return mId;
+ }
+
+private:
+ /**
+ * Unique identifier for the media session.
+ */
+ std::string mId;
+};
+
/**
* Default constructor.
*/
@@ -124,6 +154,8 @@ SipEndpoint::SipEndpoint(Ice::ObjectAdapterPtr adapter)
command = Hydra::Session::V1::SignalCommandsPrx::uncheckedCast(adapter->addWithUUID(mSignalCommands));
mSignalCallbacks = new SipSignalCallback();
callback = Hydra::Session::V1::SignalCallbackPrx::uncheckedCast(adapter->addWithUUID(mSignalCallbacks));
+ mMediaSession = new SipMediaSession();
+ mediaSession = Hydra::Media::V1::SessionPrx::uncheckedCast(adapter->addWithUUID(mMediaSession));
}
}; // end SipChannelService
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index 246f1ff..96eb8b0 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -2,6 +2,7 @@
#include <Core/Endpoint/EndpointIf.h>
#include <Session/SessionIf.h>
+#include <Media/MediaIf.h>
namespace Hydra
{
@@ -26,6 +27,11 @@ private:
* An instance of signal callbacks.
*/
Hydra::Session::V1::SignalCallbackPtr mSignalCallbacks;
+
+ /**
+ * An instance of a media session.
+ */
+ Hydra::Media::V1::SessionPtr mMediaSession;
};
}; //End namespace SipChannelService
commit 74e77a621aeef2f2ce3bbf87b01806ae17434955
Author: Joshua Colp <jcolp at digium.com>
Date: Tue Aug 24 09:35:39 2010 -0300
Get the signal commands and callbacks created and return proper proxies to them.
diff --git a/src/SipEndpoint.cpp b/src/SipEndpoint.cpp
index e88be9a..85072d5 100644
--- a/src/SipEndpoint.cpp
+++ b/src/SipEndpoint.cpp
@@ -1,3 +1,5 @@
+#include <Ice/Ice.h>
+
#include "SipEndpoint.h"
namespace Hydra
@@ -23,7 +25,7 @@ public:
//What's the difference between this and
//SignalCallback::terminated()?
}
-} _sipSignalCommands;
+};
class SipSignalCallback : public Hydra::Session::V1::SignalCallback
{
@@ -111,16 +113,17 @@ public:
//Similar to connected(), but the response code
//will be 183 instead of 200.
}
-} _sipSignalCallback;
+};
+
/**
- * Default constructor.
+ * Default constructor.
*/
-SipEndpoint::SipEndpoint()
+SipEndpoint::SipEndpoint(Ice::ObjectAdapterPtr adapter)
{
-// command = &_sipSignalCommands;
-// callback = &_sipSignalCallback;
- // XXX Should also set the id field here, too, and add it to
- // a list of endpoints. Maybe that's what the factory does?
+ mSignalCommands = new SipSignalCommands();
+ command = Hydra::Session::V1::SignalCommandsPrx::uncheckedCast(adapter->addWithUUID(mSignalCommands));
+ mSignalCallbacks = new SipSignalCallback();
+ callback = Hydra::Session::V1::SignalCallbackPrx::uncheckedCast(adapter->addWithUUID(mSignalCallbacks));
}
}; // end SipChannelService
diff --git a/src/SipEndpoint.h b/src/SipEndpoint.h
index bc77d2e..246f1ff 100644
--- a/src/SipEndpoint.h
+++ b/src/SipEndpoint.h
@@ -15,7 +15,17 @@ class SipSignalCallback;
class SipEndpoint : public Hydra::Session::V1::SessionEndpoint
{
public:
- SipEndpoint();
+ SipEndpoint(Ice::ObjectAdapterPtr);
+private:
+ /**
+ * An instance of signal commands.
+ */
+ Hydra::Session::V1::SignalCommandsPtr mSignalCommands;
+
+ /**
+ * An instance of signal callbacks.
+ */
+ Hydra::Session::V1::SignalCallbackPtr mSignalCallbacks;
};
}; //End namespace SipChannelService
diff --git a/src/SipEndpointFactory.cpp b/src/SipEndpointFactory.cpp
index 44f099a..c019c4c 100644
--- a/src/SipEndpointFactory.cpp
+++ b/src/SipEndpointFactory.cpp
@@ -8,7 +8,7 @@ namespace SipChannelService
Hydra::Session::V1::SessionEndpointPtr SipEndpointFactory::getEndpoint(std::string destination)
{
- Hydra::Session::V1::SessionEndpointPtr endpoint = new SipEndpoint();
+ Hydra::Session::V1::SessionEndpointPtr endpoint = new SipEndpoint(mAdapter);
return endpoint;
}
commit f7f20e58b87d99afa50bbdb0032f2e5d35b96486
Author: Joshua Colp <jcolp at digium.com>
Date: Tue Aug 24 09:20:14 2010 -0300
Use the endpoint factory to create and return endpoints. Next up making sure the created endpoint is proper.
diff --git a/src/SipChannelServiceEndpointLocator.cpp b/src/SipChannelServiceEndpointLocator.cpp
index 9a588e5..c174dbd 100644
--- a/src/SipChannelServiceEndpointLocator.cpp
+++ b/src/SipChannelServiceEndpointLocator.cpp
@@ -12,6 +12,7 @@ namespace SipChannelService
Hydra::Core::Endpoint::V1::EndpointSeq SipChannelServiceEndpointLocator::lookup(const ::std::string& destination, const Ice::Current&)
{
Hydra::Core::Endpoint::V1::EndpointSeq endpoints;
+ endpoints.push_back((*mEndpointFactory).getEndpoint(destination));
return endpoints;
}
diff --git a/src/SipEndpointFactory.cpp b/src/SipEndpointFactory.cpp
index 252e9fb..44f099a 100644
--- a/src/SipEndpointFactory.cpp
+++ b/src/SipEndpointFactory.cpp
@@ -1,3 +1,4 @@
+#include "SipEndpoint.h"
#include "SipEndpointFactory.h"
namespace Hydra
@@ -5,5 +6,11 @@ namespace Hydra
namespace SipChannelService
{
+Hydra::Session::V1::SessionEndpointPtr SipEndpointFactory::getEndpoint(std::string destination)
+{
+ Hydra::Session::V1::SessionEndpointPtr endpoint = new SipEndpoint();
+ return endpoint;
+}
+
}; // end SipChannelService
}; // end Hydra
diff --git a/src/SipEndpointFactory.h b/src/SipEndpointFactory.h
index 2ddd947..73cad9e 100644
--- a/src/SipEndpointFactory.h
+++ b/src/SipEndpointFactory.h
@@ -1,6 +1,7 @@
#pragma once
-#include "RoutingIf.h"
+#include <Core/Endpoint/EndpointIf.h>
+#include <Session/SessionIf.h>
namespace Hydra
{
@@ -17,6 +18,7 @@ class SipEndpointFactory
public:
SipEndpointFactory(Ice::ObjectAdapterPtr adapter) : mAdapter(adapter) { };
+ Hydra::Session::V1::SessionEndpointPtr getEndpoint(std::string destination);
private:
/**
* A pointer to the object adapter that endpoints will be added to.
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list