[asterisk-scf-commits] team/kpfleming/fosdem2011.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Sat Feb 5 04:04:53 CST 2011


branch "master" has been updated
       via  ade824dd35108f0ca494b8deb415924bbf61b522 (commit)
       via  c675d80f600e17744848aadbfe39a4baccc351b9 (commit)
      from  0dbd0032333bf8bb8b03f050e522d22166138862 (commit)

Summary of changes:
 .gitignore                          |    1 +
 Makefile                            |   18 +++++++++++-------
 sip_hook.java => fred.java          |   14 ++++++--------
 fred.py                             |   21 +++++++++++++++++++++
 example/HookI.java => fredHook.java |    6 ++----
 5 files changed, 41 insertions(+), 19 deletions(-)
 rename sip_hook.java => fred.java (76%)
 create mode 100644 fred.py
 rename example/HookI.java => fredHook.java (90%)


- Log -----------------------------------------------------------------
commit ade824dd35108f0ca494b8deb415924bbf61b522
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Sat Feb 5 11:04:48 2011 +0100

    Begin a Python example.

diff --git a/fred.py b/fred.py
new file mode 100644
index 0000000..b465b9c
--- /dev/null
+++ b/fred.py
@@ -0,0 +1,21 @@
+import sys, threading, Ice
+from AsteriskSCF.SIP.ExtensionPoint.V1 import *
+from AsteriskSCF.System.Hook.V1 import *
+
+class fredHook(AuthHook):
+    def challengeRequest(info, challenges):
+        result = HookResult()
+        result.status = HookStatus.Declined
+        return result
+
+class fred(Ice.Application):
+    def run(self, args):
+        adapter = self.communicator().createObjectAdapter("fred")
+        adapter.activate()
+#        fredHook._adapter = adapter
+        hook = fredHook()
+        self.communicator().waitForShutdown()
+        return 0
+
+app = fred()
+# sys.exit(app.main(sys.argv))

commit c675d80f600e17744848aadbfe39a4baccc351b9
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Sat Feb 5 11:02:54 2011 +0100

    Convert examples to be called 'fred'.

diff --git a/.gitignore b/.gitignore
index 6b468b6..d1c8995 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 *.class
+*.pyc
diff --git a/Makefile b/Makefile
index b845e72..11864ed 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,18 @@
-export CLASSPATH=/home/kpfleming/git/asterisk-scf/fosdem:/home/kpfleming/git/asterisk-scf/gitall/slice/target/asterisk-scf-api.jar:/opt/Ice-3.4/lib/Ice.jar
+export CLASSPATH=/home/kpfleming/git/asterisk-scf/fosdem:/home/kpfleming/git/asterisk-scf/gitall/slice/java/asterisk-scf-api.jar:/opt/Ice-3.4/lib/Ice.jar
+export PYTHONPATH=/opt/Ice-3.4/python:/home/kpfleming/git/asterisk-scf/gitall/slice/python
 
-all: sip_hook.class
+all: fred.class fred.pyc
 
-example/HookI.class: example/HookI.java
+fredHook.class: fredHook.java
 	javac -Xlint:deprecation $<
 
-sip_hook.class: sip_hook.java example/HookI.class
+fred.class: fred.java fredHook.class
 	javac -Xlint:deprecation $<
 
-clean:
-	rm -rf sip_hook.class
-	rm -rf example/HookI.class
+fred.pyc: fred.py
+	python $<
 
+clean:
+	rm -rf fred.class
+	rm -rf fredHook.class
+	rm -rf fred.pyc
diff --git a/sip_hook.java b/fred.java
similarity index 76%
rename from sip_hook.java
rename to fred.java
index f08ad41..91e8137 100644
--- a/sip_hook.java
+++ b/fred.java
@@ -1,18 +1,16 @@
-import example.*;
-
 import AsteriskSCF.System.Hook.V1.*;
 import AsteriskSCF.SIP.ExtensionPoint.V1.*;
 
-public class sip_hook extends Ice.Application
+public class fred extends Ice.Application
 {
     private HookId _hookId;
 
     public int run(String[] args)
     {
-	Ice.ObjectAdapter adapter = communicator().createObjectAdapter("sip_hook");
+	Ice.ObjectAdapter adapter = communicator().createObjectAdapter("fred");
 	adapter.activate();
-	HookI._adapter = adapter;
-	HookI hook = new HookI();
+	fredHook._adapter = adapter;
+	fredHook hook = new fredHook();
 	// this sample code does not actually locate the target SIP component
 	AuthExtensionPointPrx epPrx = AuthExtensionPointPrxHelper.uncheckedCast(communicator().stringToProxy("sip_component"));
 	_hookId = epPrx.addAuthHook(hook._proxy, new RequestType[]{ RequestType.DialogEstablishing });
@@ -23,7 +21,7 @@ public class sip_hook extends Ice.Application
 
     public static void main(String[] args)
     {
-	sip_hook app = new sip_hook();
-	System.exit(app.main("sip_hook", args));
+	fred app = new fred();
+	System.exit(app.main("fred", args));
     }
 }
diff --git a/example/HookI.java b/fredHook.java
similarity index 90%
rename from example/HookI.java
rename to fredHook.java
index a82cbd3..22b4c65 100644
--- a/example/HookI.java
+++ b/fredHook.java
@@ -1,14 +1,12 @@
-package example;
-
 import AsteriskSCF.System.Hook.V1.*;
 import AsteriskSCF.SIP.ExtensionPoint.V1.*;
 
-public class HookI extends _AuthHookDisp
+public class fredHook extends _AuthHookDisp
 {
     public static Ice.ObjectAdapter _adapter;
     public AuthHookPrx _proxy;
 
-    public HookI()
+    public fredHook()
     {
 	_proxy = AuthHookPrxHelper.uncheckedCast(_adapter.addWithUUID(this));
     }

-----------------------------------------------------------------------


-- 
team/kpfleming/fosdem2011.git



More information about the asterisk-scf-commits mailing list