Module: sems
Branch: rco/offer_answer
Commit: 1fa1cc13b5550dd098f3ade38e96eb316569e8b2
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=1fa1cc13b5550dd098f3ade38e96eb316569e8b2

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Mon May 23 14:25:16 2011 +0200

some ivr fixes related to offer_answer changes.

---

 apps/examples/ivr_examples/b2b_out.py    |    2 +-
 apps/examples/ivr_examples/b2bua.py      |    4 ++--
 apps/examples/ivr_examples/db_balance.py |    2 +-
 apps/examples/ivr_examples/play.py       |    2 +-
 apps/examples/ivr_examples/rec.py        |    2 +-
 apps/examples/ivr_examples/test_mp3.py   |    2 +-
 apps/examples/ivr_examples/tmpfile.py    |    2 +-
 apps/ivr/Ivr.cpp                         |    8 +++-----
 8 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/apps/examples/ivr_examples/b2b_out.py 
b/apps/examples/ivr_examples/b2b_out.py
index 016f1f8..e2a7337 100644
--- a/apps/examples/ivr_examples/b2b_out.py
+++ b/apps/examples/ivr_examples/b2b_out.py
@@ -6,7 +6,7 @@ from ivr import *
 
 class IvrDialog(IvrDialogBase):
     
-    def onSessionStart(self, hdrs):
+    def onSessionStart(self):
 
         info("starting b2bua app ...")
         self.setNoRelayonly()        
diff --git a/apps/examples/ivr_examples/b2bua.py 
b/apps/examples/ivr_examples/b2bua.py
index 8f6cc9b..77951f5 100644
--- a/apps/examples/ivr_examples/b2bua.py
+++ b/apps/examples/ivr_examples/b2bua.py
@@ -5,11 +5,11 @@ from log import *
 from ivr import *
 
 WELLCOME_MSG = "wav/default_en.wav"
-CALLEE_URI = "sip:[email protected]"
+CALLEE_URI = "sip:[email protected]"
 
 class IvrDialog(IvrDialogBase):
     
-    def onSessionStart(self, hdrs):
+    def onSessionStart(self):
 
         info("starting b2bua test ...")
 
diff --git a/apps/examples/ivr_examples/db_balance.py 
b/apps/examples/ivr_examples/db_balance.py
index 8843dea..f1041f2 100644
--- a/apps/examples/ivr_examples/db_balance.py
+++ b/apps/examples/ivr_examples/db_balance.py
@@ -26,7 +26,7 @@ db = MySQLdb.connection(host="127.0.0.1", user="root", 
passwd="sa07", db="busine
 class IvrDialog(IvrDialogBase) :
     ttsfile = None
 
-    def onSessionStart( self, hdrs ) :
+    def onSessionStart(self) :
         db.query("select bal_int, bal_decimal from accounts where user='%s'" % 
self.dialog.user)
         r = db.store_result()
         res = r.fetch_row(1)
diff --git a/apps/examples/ivr_examples/play.py 
b/apps/examples/ivr_examples/play.py
index 1fc29f1..51b4a65 100644
--- a/apps/examples/ivr_examples/play.py
+++ b/apps/examples/ivr_examples/play.py
@@ -6,7 +6,7 @@ from ivr import *
 
 class IvrDialog(IvrDialogBase) :
 
-    def onSessionStart( self, hdrs ) :
+    def onSessionStart(self) :
         self.audio_pl = IvrAudioFile()
         self.audio_pl.open("wav/default_en.wav", AUDIO_READ)
 
diff --git a/apps/examples/ivr_examples/rec.py 
b/apps/examples/ivr_examples/rec.py
index b37a638..2485f00 100644
--- a/apps/examples/ivr_examples/rec.py
+++ b/apps/examples/ivr_examples/rec.py
@@ -6,7 +6,7 @@ from ivr import *
 
 class IvrDialog(IvrDialogBase) :
 
-    def onSessionStart( self, hdrs ) :
+    def onSessionStart(self) :
 
         self.audio_msg = IvrAudioFile()
         self.audio_msg.open("record.wav", AUDIO_WRITE)
diff --git a/apps/examples/ivr_examples/test_mp3.py 
b/apps/examples/ivr_examples/test_mp3.py
index 2572f5a..c8e0156 100644
--- a/apps/examples/ivr_examples/test_mp3.py
+++ b/apps/examples/ivr_examples/test_mp3.py
@@ -6,7 +6,7 @@ from log import *
 from ivr import *
 class IvrDialog(IvrDialogBase):
 
-       def onSessionStart(self, hdrs):
+       def onSessionStart(self):
                self.voice_msg = IvrAudioFile()
                self.voice_msg.open("play.mp3", AUDIO_READ, False)
                self.enqueue(self.voice_msg, None)
diff --git a/apps/examples/ivr_examples/tmpfile.py 
b/apps/examples/ivr_examples/tmpfile.py
index e98585b..f2d63bf 100644
--- a/apps/examples/ivr_examples/tmpfile.py
+++ b/apps/examples/ivr_examples/tmpfile.py
@@ -7,7 +7,7 @@ import os
 
 class IvrDialog(IvrDialogBase):
 
-       def onSessionStart(self, hdrs):
+       def onSessionStart(self):
 
                info("starting tmpfile.py")
                f = open("/tmp/default_en.wav")
diff --git a/apps/ivr/Ivr.cpp b/apps/ivr/Ivr.cpp
index 601ffae..6f490f4 100644
--- a/apps/ivr/Ivr.cpp
+++ b/apps/ivr/Ivr.cpp
@@ -566,10 +566,7 @@ void IvrFactory::setupSessionTimer(AmSession* s) {
  */
 AmSession* IvrFactory::onInvite(const AmSipRequest& req, const string& 
app_name)
 {
-  // if(req.cmd != MOD_NAME)
-  //   return newDlg(req.cmd);
-  // else
-  return newDlg(req.user);
+  return newDlg(app_name);
 }
 
 IvrDialog::IvrDialog()
@@ -695,7 +692,8 @@ bool IvrDialog::callPyEventHandler(const char* name, const 
char* fmt, ...)
 
 void IvrDialog::onInvite(const AmSipRequest& req)
 {
-  callPyEventHandler("onInvite","(s)",req.hdrs.c_str());
+  if(callPyEventHandler("onInvite","(s)",req.hdrs.c_str()))
+    AmB2BCallerSession::onInvite(req);
 }
 
 void IvrDialog::onSessionStart()

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to