[hydra-commits] ken.hunt: branch techdemo/ken.hunt/pythonTest r610 - in /techdemo/team/ken.hu...
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Tue May 4 17:28:01 CDT 2010
Author: ken.hunt
Date: Tue May 4 17:28:00 2010
New Revision: 610
URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=610
Log:
Simple python test.
Added:
techdemo/team/ken.hunt/pythonTest/
techdemo/team/ken.hunt/pythonTest/Client.py (with props)
techdemo/team/ken.hunt/pythonTest/Server.py (with props)
techdemo/team/ken.hunt/pythonTest/runslice.bat (with props)
techdemo/team/ken.hunt/pythonTest/slice/
techdemo/team/ken.hunt/pythonTest/slice/Channel/
techdemo/team/ken.hunt/pythonTest/slice/Channel/CMakeLists.txt (with props)
techdemo/team/ken.hunt/pythonTest/slice/Channel/ChannelServiceIf.ice (with props)
techdemo/team/ken.hunt/pythonTest/slice/Channel/EndpointIf.ice (with props)
techdemo/team/ken.hunt/pythonTest/slice/Channel/SignalIf.ice (with props)
techdemo/team/ken.hunt/pythonTest/slice/Media/
techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt (with props)
techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice (with props)
techdemo/team/ken.hunt/pythonTest/slice/Media/MediaTranslationIf.ice (with props)
techdemo/team/ken.hunt/pythonTest/slice/RoutingServiceIf.ice (with props)
Added: techdemo/team/ken.hunt/pythonTest/Client.py
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/Client.py?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/Client.py (added)
+++ techdemo/team/ken.hunt/pythonTest/Client.py Tue May 4 17:28:00 2010
@@ -1,0 +1,20 @@
+import sys, traceback, Ice
+import RoutingServiceIf_ice
+import EndpointIf_ice
+import Hydra
+
+ic = None
+status=0
+try:
+ ic = Ice.initialize(sys.argv)
+ base = ic.stringToProxy("LookupService:default -p 10000")
+ registry = Hydra.Routing.LookupServicePrx.checkedCast(base)
+ if not registry:
+ raise RuntimeError("Invalid proxy")
+
+ ep = registry.lookup("200")
+ print(ep.GetId())
+
+except:
+ traceback.print_exc()
+ status = 1
Propchange: techdemo/team/ken.hunt/pythonTest/Client.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/Client.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: techdemo/team/ken.hunt/pythonTest/Client.py
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/Client.py
------------------------------------------------------------------------------
svn:mime-type = text/x-python
Added: techdemo/team/ken.hunt/pythonTest/Server.py
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/Server.py?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/Server.py (added)
+++ techdemo/team/ken.hunt/pythonTest/Server.py Tue May 4 17:28:00 2010
@@ -1,0 +1,61 @@
+
+import sys, traceback, Ice
+import RoutingServiceIf_ice
+import EndpointIf_ice
+
+import Hydra
+
+class EndpointI(Hydra.Channel.Endpoint):
+ def GetId(self, current=None):
+ return "Happy123"
+ def SetOutgoingMediaSink(self, outSink, current=None):
+ local=outSink
+ def GetConcurrentCalls(self, current=None):
+ return 7
+ def GetCompletedCalls(self, current=None):
+ return 9
+
+class LookupServiceI(Hydra.Routing.LookupService):
+ def __init__(self):
+ print "LookupService is initialized."
+ def lookup(self, destination, current=None):
+ print ("lookup called with destination=" + destination)
+ return self.ep
+ def setEndpoint(self, ep):
+ self.ep = ep;
+
+status = 0
+ic = None
+try:
+ ic = Ice.initialize(sys.argv)
+ adapter = ic.createObjectAdapterWithEndpoints(
+ "RoutingService", "default -p 10000")
+
+ id = ic.stringToIdentity("TestEndpoint")
+ ep = EndpointI()
+ adapter.add(ep,id)
+
+ object = LookupServiceI()
+ adapter.add(object, ic.stringToIdentity("LookupService"))
+ adapter.activate()
+
+ objectPrx = adapter.createDirectProxy(id)
+ epPrx = Hydra.Channel.EndpointPrx.checkedCast(objectPrx)
+
+ object.setEndpoint(epPrx)
+
+ ic.waitForShutdown()
+except:
+ traceback.print_exc()
+ status = 1
+
+if ic:
+ # Clean up
+ try:
+ ic.destroy()
+ except:
+ traceback.print_exc()
+ status = 1
+
+sys.exit(status)
+
Propchange: techdemo/team/ken.hunt/pythonTest/Server.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/Server.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: techdemo/team/ken.hunt/pythonTest/Server.py
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/Server.py
------------------------------------------------------------------------------
svn:mime-type = text/x-python
Added: techdemo/team/ken.hunt/pythonTest/runslice.bat
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/runslice.bat?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/runslice.bat (added)
+++ techdemo/team/ken.hunt/pythonTest/runslice.bat Tue May 4 17:28:00 2010
@@ -1,0 +1,22 @@
+
+set SLICEDIR=X:\techdemo\team\ken.hunt\pythonTest\slice
+
+slice2py -I%SLICEDIR% -I%SLICEDIR%\Channel -I%SLICEDIR%\Media %SLICEDIR%\RoutingServiceIf.ice
+
+slice2py -I%SLICEDIR% -I%SLICEDIR%\Channel -I%SLICEDIR%\Media %SLICEDIR%\Channel\ChannelServiceIf.ice
+slice2py -I%SLICEDIR% -I%SLICEDIR%\Channel -I%SLICEDIR%\Media %SLICEDIR%\Channel\EndpointIf.ice
+slice2py -I%SLICEDIR% -I%SLICEDIR%\Channel -I%SLICEDIR%\Media %SLICEDIR%\Channel\SignalIf.ice
+
+slice2py -I%SLICEDIR% -I%SLICEDIR%\Channel -I%SLICEDIR%\Media %SLICEDIR%\Media\MediaSinkIf.ice
+slice2py -I%SLICEDIR% -I%SLICEDIR%\Channel -I%SLICEDIR%\Media %SLICEDIR%\Media\MediaTranslationIf.ice
+
+REM *****
+
+REM slice2py --output-dir slicescripts/Hydra -Islice -I%SLICEDIR%\Channel -I%SLICEDIR%\Media slice\RoutingServiceIf.ice
+
+REM slice2py --output-dir slicescripts/Hydra/Channel -Islice -I%SLICEDIR%\Channel -I%SLICEDIR%\Media slice\Channel\ChannelServiceIf.ice
+REM slice2py --output-dir slicescripts/Hydra/Channel -Islice -I%SLICEDIR%\Channel -I%SLICEDIR%\Media slice\Channel\EndpointIf.ice
+REM slice2py --output-dir slicescripts/Hydra/Channel -Islice -I%SLICEDIR%\Channel -I%SLICEDIR%\Media slice\Channel\SignalIf.ice
+
+REM slice2py --output-dir slicescripts/Hydra/Media -Islice -I%SLICEDIR%\Channel -I%SLICEDIR%\Media slice\Media\MediaSinkIf.ice
+REM slice2py --output-dir slicescripts/Hydra/Media -Islice -I%SLICEDIR%\Channel -I%SLICEDIR%\Media slice\Media\MediaTranslationIf.ice
Propchange: techdemo/team/ken.hunt/pythonTest/runslice.bat
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/runslice.bat
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/runslice.bat
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/Channel/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/Channel/CMakeLists.txt?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/Channel/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/Channel/CMakeLists.txt Tue May 4 17:28:00 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/pythonTest/slice/Channel/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/CMakeLists.txt
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/CMakeLists.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/Channel/ChannelServiceIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/Channel/ChannelServiceIf.ice?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/Channel/ChannelServiceIf.ice (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/Channel/ChannelServiceIf.ice Tue May 4 17:28:00 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/pythonTest/slice/Channel/ChannelServiceIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/ChannelServiceIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/ChannelServiceIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/Channel/EndpointIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/Channel/EndpointIf.ice?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/Channel/EndpointIf.ice (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/Channel/EndpointIf.ice Tue May 4 17:28:00 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/pythonTest/slice/Channel/EndpointIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/EndpointIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/EndpointIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/Channel/SignalIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/Channel/SignalIf.ice?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/Channel/SignalIf.ice (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/Channel/SignalIf.ice Tue May 4 17:28:00 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/pythonTest/slice/Channel/SignalIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/SignalIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Channel/SignalIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt Tue May 4 17:28:00 2010
@@ -1,0 +1,3 @@
+hydra_compile_slice(MediaSinkIf.ice)
+
+hydra_compile_slice(MediaTranslationIf.ice)
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/CMakeLists.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice Tue May 4 17:28:00 2010
@@ -1,0 +1,15 @@
+#pragma once
+
+module Hydra
+{
+ module Media
+ {
+ interface MediaSink
+ {
+ string GetMediaFormat();
+ void SendFrames(string media);
+ };
+
+ };
+
+};
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/MediaSinkIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/Media/MediaTranslationIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/Media/MediaTranslationIf.ice?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/Media/MediaTranslationIf.ice (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/Media/MediaTranslationIf.ice Tue May 4 17:28:00 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/pythonTest/slice/Media/MediaTranslationIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/MediaTranslationIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/Media/MediaTranslationIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: techdemo/team/ken.hunt/pythonTest/slice/RoutingServiceIf.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/pythonTest/slice/RoutingServiceIf.ice?view=auto&rev=610
==============================================================================
--- techdemo/team/ken.hunt/pythonTest/slice/RoutingServiceIf.ice (added)
+++ techdemo/team/ken.hunt/pythonTest/slice/RoutingServiceIf.ice Tue May 4 17:28:00 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/pythonTest/slice/RoutingServiceIf.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: techdemo/team/ken.hunt/pythonTest/slice/RoutingServiceIf.ice
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: techdemo/team/ken.hunt/pythonTest/slice/RoutingServiceIf.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-scf-commits
mailing list