[hydra-commits] ken.hunt: branch techdemo/ken.hunt/embeddedLuaTest r618 - in /techdemo/team/k...
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Thu May 13 14:54:05 CDT 2010
Author: ken.hunt
Date: Thu May 13 14:54:04 2010
New Revision: 618
URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=618
Log:
testing
Added:
techdemo/team/ken.hunt/embeddedLuaTest/ (with props)
techdemo/team/ken.hunt/embeddedLuaTest/build/
techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/
techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/
techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/
techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice (with props)
techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice (with props)
techdemo/team/ken.hunt/embeddedLuaTest/source/
techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt (with props)
techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp (with props)
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/
------------------------------------------------------------------------------
--- svn:externals (added)
+++ svn:externals Thu May 13 14:54:04 2010
@@ -1,0 +1,1 @@
+^/cmake/trunk cmake
Added: techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat Thu May 13 14:54:04 2010
@@ -1,0 +1,6 @@
+ at ECHO OFF
+REM -Wdev: Enable developer warnings.
+REM --build <sourcedir> : for out-of-source building
+
+cmake -Wdev --build ..
+
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/build/runcmake.bat
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt Thu May 13 14:54:04 2010
@@ -1,0 +1,7 @@
+hydra_slice_include_directories(.)
+
+add_subdirectory(Media)
+add_subdirectory(Channel)
+
+
+hydra_compile_slice(RoutingServiceIf.ice)
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/CMakeLists.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt Thu May 13 14:54:04 2010
@@ -1,0 +1,10 @@
+hydra_compile_slice(SignalIf.ice)
+
+hydra_compile_slice(EndpointIf.ice)
+
+hydra_compile_slice(ChannelServiceIf.ice)
+
+
+
+
+
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/CMakeLists.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice Thu May 13 14:54:04 2010
@@ -1,0 +1,48 @@
+#pragma once
+
+#include <Channel/SignalIf.ice>
+#include <Channel/EndpointIf.ice>
+
+module Hydra
+{
+ module Channel
+ {
+ exception EndpointNotFound
+ {
+ string requestedEndpoint;
+ };
+
+ exception EndpointAlreadyRegistered
+ {
+ string endpoint;
+ };
+
+ interface DeviceRegistry
+ {
+ void RegisterDevice(Endpoint *device) throws EndpointAlreadyRegistered;
+ void DeregisterDevice(string deviceId) throws EndpointNotFound;
+ void ClearDeviceRegistry();
+
+ Endpoint *GetEndpoint(string deviceId) throws EndpointNotFound;
+ Endpoint *GetEndpointWithFormat(string deviceId, string format) throws EndpointNotFound;
+ };
+
+ interface ChannelStatus
+ {
+ int GetCallsInProgess(string deviceId) throws EndpointNotFound;
+ };
+
+ interface ChannelStatusExtraV2
+ {
+ int GetTotalCallsProcessed(string deviceId) throws EndpointNotFound;
+ };
+
+ interface ChannelService extends DeviceRegistry, Signal
+ {
+ void OnCallNotice(string deviceId);
+ ChannelStatus *GetStatus();
+ };
+
+ };
+
+};
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/ChannelServiceIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice Thu May 13 14:54:04 2010
@@ -1,0 +1,21 @@
+#pragma once
+
+#include <Media/MediaSinkIf.ice>
+#include <Channel/SignalIf.ice>
+
+module Hydra
+{
+ module Channel
+ {
+ interface Endpoint extends Signal, Media::MediaSink
+ {
+ string GetId();
+ void SetOutgoingMediaSink(Media::MediaSink *outSink);
+ void RequestMediaFormat(string format);
+ int GetConcurrentCalls();
+ int GetCompletedCalls();
+ };
+
+ };
+
+};
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/EndpointIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice Thu May 13 14:54:04 2010
@@ -1,0 +1,44 @@
+#pragma once
+
+#include <Media/MediaSinkIf.ice>
+
+module Hydra
+{
+ module Channel
+ {
+ enum InviteResponse
+ {
+ OK,
+ BUSY
+ };
+
+ exception DestinationNotFoundException
+ {
+ };
+
+ exception UnknownSignalSource
+ {
+ };
+
+ exception RoutingServiceInaccessible
+ {
+ };
+
+ exception InvalidOperationForState
+ {
+ string details;
+ };
+
+ interface Signal
+ {
+ void Invite(Signal *source, string destId, string callerId) throws DestinationNotFoundException, UnknownSignalSource, RoutingServiceInaccessible,InvalidOperationForState;
+ void ReplyToInvite(Signal *source, string callerId, InviteResponse response);
+ void Ringing(Signal *source, string callerId);
+ void Bye(Signal *source);
+ void Redirect(Signal *source, Signal *newReplyTo);
+ };
+
+
+ };
+
+};
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Channel/SignalIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt Thu May 13 14:54:04 2010
@@ -1,0 +1,3 @@
+hydra_compile_slice(MediaSinkIf.ice)
+
+hydra_compile_slice(MediaTranslationIf.ice)
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/CMakeLists.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice Thu May 13 14:54:04 2010
@@ -1,0 +1,15 @@
+#pragma once
+
+module Hydra
+{
+ module Media
+ {
+ interface MediaSink
+ {
+ string GetMediaFormat();
+ void SendFrames(string media);
+ };
+
+ };
+
+};
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaSinkIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice Thu May 13 14:54:04 2010
@@ -1,0 +1,23 @@
+#pragma once
+
+#include <Media/MediaSinkIf.ice>
+
+module Hydra
+{
+ module Media
+ {
+ exception InvalidParamsException
+ {
+ };
+ interface MediaTranslationSink extends MediaSink
+ {
+ void Destroy();
+ };
+ interface MediaTranslation
+ {
+ MediaTranslationSink *Create(string from, string to, MediaSink *step) throws InvalidParamsException;
+ };
+
+ };
+
+};
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/Media/MediaTranslationIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice Thu May 13 14:54:04 2010
@@ -1,0 +1,35 @@
+#pragma once
+
+#include <Channel/EndpointIf.ice>
+#include <Channel/ChannelServiceIf.ice>
+
+module Hydra
+{
+ module Routing
+ {
+ exception DestinationNotFoundException
+ {
+ };
+ exception DestinationExistsException
+ {
+ };
+ exception InvalidParamsException
+ {
+ };
+ interface LookupService
+ {
+ // The routing service is responsible for using the information it has to construct a proxy that it returns
+ idempotent Channel::Endpoint *lookup(string destination) throws DestinationNotFoundException, InvalidParamsException;
+ };
+ interface ConfigurationService
+ {
+ void AddEndpoint(string destination, string service, string target, string format) throws DestinationExistsException, InvalidParamsException;
+ void SetFormat(string destination, string format) throws DestinationNotFoundException, InvalidParamsException;
+ void RemoveEndpoint(string destination) throws DestinationNotFoundException, InvalidParamsException;
+ void ClearEndpoints();
+ void ClearEndpointsForService(string service);
+ };
+
+ };
+
+};
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/slice/RoutingServiceIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt Thu May 13 14:54:04 2010
@@ -1,0 +1,16 @@
+
+hydra_component_init(Routing CXX)
+INCLUDE(FindLua51)
+get_filename_component(LUA_LOC ${LUA_LIBRARIES} PATH)
+LINK_DIRECTORIES(${LUA_LOC})
+include_directories(${LUA_INCLUDE_DIR})
+hydra_component_add_slice(Routing MediaSinkIf)
+hydra_component_add_slice(Routing EndpointIf)
+hydra_component_add_slice(Routing SignalIf)
+hydra_component_add_slice(Routing ChannelServiceIf)
+hydra_component_add_slice(Routing RoutingServiceIf)
+hydra_component_add_file(Routing Server.cpp)
+hydra_component_add_ice_libraries(Routing IceStorm)
+hydra_component_add_boost_libraries(Routing core)
+hydra_component_build_standalone(Routing)
+hydra_component_install(Routing)
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/source/CMakeLists.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp?view=auto&rev=618
==============================================================================
--- techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp (added)
+++ techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp Thu May 13 14:54:04 2010
@@ -1,0 +1,127 @@
+#include <Ice/Ice.h>
+#include <boost/cast.hpp>
+#include <boost/shared_ptr.hpp>
+#include <typeinfo>
+#include "lua.h"
+#include "lualib.h"
+#include "lauxlib.h"
+
+#include "RoutingServiceIf.h"
+
+using namespace std;
+using namespace Hydra;
+
+
+class LookupServiceImpl : public Hydra::Routing::LookupService
+{
+public:
+ virtual ::Hydra::Channel::EndpointPrx lookup(const ::std::string& destination, const ::Ice::Current& __context);
+};
+
+
+::Hydra::Channel::EndpointPrx LookupServiceImpl::lookup(const ::std::string& destination, const ::Ice::Current& __context)
+{
+ cout << "Looking up: " << destination << std::endl;
+
+ PyObject *pName, *pModule;
+
+ // TEMP...Changed to a simple python script. Make
+ // sure my pythonScripts folder is in PYTHONPATH
+ pName = PyString_FromString("lookup");
+ pModule = PyImport_Import(pName);
+ Py_DECREF(pName);
+
+ if (pModule != 0)
+ {
+ PyObject *pFunc = PyObject_GetAttrString(pModule, "lookup");
+ if (pFunc != 0 && PyCallable_Check(pFunc))
+ {
+ PyObject *pArgs = PyTuple_New(1);
+ PyObject *pValue = PyInt_FromLong(atoi(destination.c_str()));
+ if (!pValue)
+ {
+ Py_DECREF(pArgs);
+ Py_DECREF(pFunc);
+ Py_DECREF(pModule);
+ return 0;
+ }
+ PyTuple_SetItem(pArgs, 0, pValue); // pValue ref given up here.
+
+ pValue = PyObject_CallObject(pFunc, pArgs);
+ Py_DECREF(pArgs);
+
+ if (pValue != 0)
+ {
+ cout << "Found: " << PyInt_AsLong(pValue) << std::endl;
+ Py_DECREF(pValue);
+ }
+ else
+ {
+ PyErr_Print();
+ }
+
+ Py_DECREF(pFunc);
+ Py_DECREF(pModule);
+ }
+ else if (PyErr_Occurred())
+ {
+ PyErr_Print();
+ }
+ }
+ else
+ {
+ PyErr_Print();
+ }
+ Py_Finalize();
+ return 0;
+}
+
+
+int main(int argc, char* argv[])
+{
+ int status = 0;
+ Ice::CommunicatorPtr ic;
+
+ Py_Initialize();
+
+ try
+ {
+ ic = Ice::initialize(argc, argv);
+ Ice::ObjectAdapterPtr adapter = ic->createObjectAdapterWithEndpoints("LookupService",
+ "default -p 10007");
+
+ Hydra::Routing::LookupServicePtr service = new LookupServiceImpl();
+ Ice::ObjectPrx objectPrx = adapter->add(service, ic->stringToIdentity("LookupService"));
+ Hydra::Routing::LookupServicePrx lookupPrx = Hydra::Routing::LookupServicePrx::uncheckedCast(objectPrx);
+
+ adapter->activate();
+
+ // Hardcode an invocation.
+ service->lookup("27");
+
+ ic->waitForShutdown();
+ }
+ catch (const Ice::Exception& e)
+ {
+ cerr << e << endl;
+ status = 1;
+ }
+ catch (const char* msg)
+ {
+ cerr << msg << endl;
+ status = 1;
+ }
+ if (ic)
+ {
+ try
+ {
+ ic->destroy();
+ }
+ catch (const Ice::Exception& e)
+ {
+ cerr << e << endl;
+ status = 1;
+ }
+ }
+ return status;
+}
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/embeddedLuaTest/source/Server.cpp
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-scf-commits
mailing list