Browse code

updated py_sems for new AmSession/AmB2BSession API (wip)

Stefan Sayer authored on 18/07/2011 17:35:33
Showing 8 changed files
... ...
@@ -28,11 +28,21 @@ PySemsB2ABDialog::~PySemsB2ABDialog()
28 28
 {
29 29
 }
30 30
 
31
-void PySemsB2ABDialog::onSessionStart(const AmSipRequest& req)
31
+void PySemsB2ABDialog::onBeforeDestroy() {
32
+  AmB2ABCallerSession::onBeforeDestroy();
33
+}
34
+
35
+void PySemsB2ABDialog::onEarlySessionStart() {
36
+  DBG("PySemsB2ABDialog::onEarlySessionStart\n");
37
+  setInOut(&playlist,&playlist);
38
+  AmB2ABCallerSession::onEarlySessionStart();
39
+}
40
+
41
+void PySemsB2ABDialog::onSessionStart()
32 42
 {
33 43
   DBG("PySemsB2ABDialog::onSessionStart\n");
34 44
   setInOut(&playlist,&playlist);
35
-  AmB2ABCallerSession::onSessionStart(req);
45
+  AmB2ABCallerSession::onSessionStart();
36 46
 }
37 47
 
38 48
 AmB2ABCalleeSession* PySemsB2ABDialog::createCalleeSession() {
... ...
@@ -37,11 +37,14 @@ class PySemsB2ABDialog : public AmB2ABCallerSession,
37 37
   PySemsB2ABDialog();
38 38
   virtual ~PySemsB2ABDialog();
39 39
 
40
-  void onSessionStart(const AmSipRequest& req);
40
+  void onEarlySessionStart();
41
+  void onSessionStart();
41 42
 
42 43
   // @see AmEventHandler
43 44
   void process(AmEvent* event);
44 45
 
46
+  void onBeforeDestroy();
47
+
45 48
   AmB2ABCalleeSession* createCalleeSession();
46 49
 };
47 50
 
... ...
@@ -30,11 +30,11 @@ PySemsB2BDialog::~PySemsB2BDialog()
30 30
 {
31 31
 }
32 32
 
33
-void PySemsB2BDialog::onSessionStart(const AmSipRequest& req)
33
+void PySemsB2BDialog::onSessionStart()
34 34
 {
35 35
   DBG("PySemsB2BDialog::onSessionStart\n");
36 36
   setInOut(&playlist,&playlist);
37
-  AmB2BCallerSession::onSessionStart(req);
37
+  AmB2BCallerSession::onSessionStart();
38 38
 }
39 39
 
40 40
 void PySemsB2BDialog::process(AmEvent* event) 
... ...
@@ -36,7 +36,7 @@ class PySemsB2BDialog : public AmB2BCallerSession,
36 36
   PySemsB2BDialog();
37 37
   virtual ~PySemsB2BDialog();
38 38
 
39
-  void onSessionStart(const AmSipRequest& req);
39
+  void onSessionStart();
40 40
 
41 41
   // @see AmEventHandler
42 42
   void process(AmEvent* event);
... ...
@@ -9,11 +9,13 @@ class AmSipDialog
9 9
 
10 10
 public:
11 11
     enum Status {
12
-	
13
-	Disconnected=0,
14
-	Pending,
15
-	Connected,
16
-	Disconnecting
12
+    Disconnected=0,
13
+    Trying,
14
+    Proceeding,
15
+    Cancelling,
16
+    Early,
17
+    Connected,
18
+    Disconnecting
17 19
     };
18 20
 
19 21
     string user;         // local user
... ...
@@ -40,8 +42,8 @@ public:
40 42
     int    getStatus();
41 43
     string getContactHdr();
42 44
 
43
-    void updateStatus(const AmSipRequest& /* req */);
44
-    void updateStatus(const AmSipReply& /* reply */);
45
+    void onRxRequest(const AmSipRequest& /* req */);
46
+    void onRxReply(const AmSipReply& /* reply */);
45 47
 
46 48
     int reply(const AmSipRequest& /* req */,
47 49
  	      unsigned int  /* code */, 
... ...
@@ -36,15 +36,13 @@ public:
36 36
     fprintf(stderr,"------------- dealloc_PySemsB2ABDialog ----------\n");
37 37
 %End
38 38
 
39
-    int acceptAudio(const string& /* body */,
40
-		    const string& /* hdrs */,
41
-		    string* /Out/ /* sdp_reply */);
42
-
43 39
     void setStopped();
40
+    virtual void onBeforeDestroy();
44 41
 
45 42
     virtual void onInvite(const AmSipRequest& /* req */);
46
-    virtual void onSessionStart(const AmSipRequest& /* req */);
47
-    virtual void onCancel();
43
+    virtual void onCancel(const AmSipRequest& /* req */);
44
+    virtual void onSessionStart();
45
+    virtual void onEarlySessionStart();
48 46
 
49 47
     virtual void onBye(const AmSipRequest& /* req */);
50 48
     virtual void onDtmf(int /* event */, int /* duration_msec */);
... ...
@@ -17,15 +17,13 @@ public:
17 17
     fprintf(stderr,"------------- dealloc_PySemsB2BDialog ----------\n");
18 18
 %End
19 19
 
20
-    int acceptAudio(const string& /* body */,
21
-		    const string& /* hdrs */,
22
-		    string* /Out/ /* sdp_reply */);
23
-
24 20
     void setStopped();
21
+    virtual void onBeforeDestroy();
25 22
 
26 23
     virtual void onInvite(const AmSipRequest& /* req */);
27
-    virtual void onSessionStart(const AmSipRequest& /* req */);
28
-    virtual void onCancel();
24
+    virtual void onCancel(const AmSipRequest& /* req */);
25
+    virtual void onSessionStart();
26
+    virtual void onEarlySessionStart();
29 27
 
30 28
     virtual void onBye(const AmSipRequest& /* req */);
31 29
     virtual void onDtmf(int /* event */, int /* duration_msec */);
... ...
@@ -17,15 +17,11 @@ public:
17 17
     fprintf(stderr,"------------- dealloc_PySemsDialog ----------\n");
18 18
 %End
19 19
 
20
-    int acceptAudio(const string& /* body */,
21
-		    const string& /* hdrs */,
22
-		    string* /Out/ /* sdp_reply */);
23
-
24 20
     void setStopped();
25 21
 
26 22
     virtual void onInvite(const AmSipRequest& /* req */);
27 23
     virtual void onSessionStart(const AmSipRequest& /* req */);
28
-    virtual void onCancel();
24
+    virtual void onCancel(const AmSipRequest& /* req */);
29 25
 
30 26
     virtual void onBye(const AmSipRequest& /* req */);
31 27
     virtual void onDtmf(int /* event */, int /* duration_msec */);