Browse code

b2b with media relay changes:

b2ab_caller_owns_connector.patch:
AmB2ABCallerSession owns the session connector.
Caller session waits for callee session to end before it ends itself.

early media support for B2ABSession.



git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1164 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Stefan Sayer authored on 08/12/2008 14:30:29
Showing 43 changed files
... ...
@@ -304,14 +304,15 @@ void CallBackDialog::process(AmEvent* ev)
304 304
 
305 305
 // need this to pass credentials...
306 306
 AmB2ABCalleeSession* CallBackDialog::createCalleeSession() {
307
-  CallBackCalleeDialog* sess = new CallBackCalleeDialog(getLocalTag(), cred);
307
+  CallBackCalleeDialog* sess = new CallBackCalleeDialog(getLocalTag(), connector, cred);
308 308
   addAuthHandler(sess);
309 309
   return sess;
310 310
 }
311 311
 
312 312
 CallBackCalleeDialog::CallBackCalleeDialog(const string& other_tag, 
313
-				     UACAuthCred* cred) 
314
-  : AmB2ABCalleeSession(other_tag), cred(cred)
313
+					   AmSessionAudioConnector* connector,
314
+					   UACAuthCred* cred) 
315
+  : AmB2ABCalleeSession(other_tag, connector), cred(cred)
315 316
 {
316 317
   // set configured playout type
317 318
   rtp_str.setPlayoutType(CallBackFactory::m_PlayoutType);
... ...
@@ -126,7 +126,9 @@ class CallBackCalleeDialog
126 126
 {
127 127
   UACAuthCred* cred;
128 128
 public:
129
-  CallBackCalleeDialog(const string& other_tag, UACAuthCred* cred);
129
+  CallBackCalleeDialog(const string& other_tag,
130
+		       AmSessionAudioConnector* connector,
131
+		       UACAuthCred* cred);
130 132
   ~CallBackCalleeDialog();
131 133
   UACAuthCred* getCredentials() { return cred; }
132 134
 };
... ...
@@ -98,9 +98,11 @@ b2b_connectDialog::~b2b_connectDialog()
98 98
 
99 99
 void b2b_connectDialog::onInvite(const AmSipRequest& req)
100 100
 {
101
-  // TODO: do reinvites get here? if so, don't set a timer then
102
-  // -> yes, they do.
103
-
101
+  if (dlg.getStatus() == AmSipDialog::Connected) {
102
+    // reinvites
103
+    AmB2ABCallerSession::onInvite(req);
104
+    return;
105
+  }
104 106
 
105 107
   string app_param = getHeader(req.hdrs, PARAM_HDR);
106 108
 
... ...
@@ -228,7 +230,9 @@ void b2b_connectDialog::onCancel()
228 230
 
229 231
 AmB2ABCalleeSession* b2b_connectDialog::createCalleeSession()
230 232
 {
231
-  b2b_connectCalleeSession* sess = new b2b_connectCalleeSession(getLocalTag(), user, password);
233
+  b2b_connectCalleeSession* sess = new b2b_connectCalleeSession(getLocalTag(), 						   
234
+								connector, 
235
+								user, password);
232 236
 
233 237
   AmSessionEventHandlerFactory* uac_auth_f = 
234 238
     AmPlugIn::instance()->getFactory4Seh("uac_auth");
... ...
@@ -250,10 +254,11 @@ AmB2ABCalleeSession* b2b_connectDialog::createCalleeSession()
250 254
 }
251 255
 
252 256
 b2b_connectCalleeSession::b2b_connectCalleeSession(const string& other_tag,
257
+						   AmSessionAudioConnector* connector,
253 258
 						   const string& user, const string& pwd) 
254 259
   : credentials("", user, pwd), // domain (realm) is unused in credentials 
255
-    AmB2ABCalleeSession(other_tag) {
256
-
260
+    AmB2ABCalleeSession(other_tag, connector) 
261
+{
257 262
   rtp_str.setPlayoutType(ADAPTIVE_PLAYOUT); 
258 263
   setDtmfDetectionEnabled(false);
259 264
 }
... ...
@@ -90,7 +90,9 @@ class b2b_connectCalleeSession
90 90
    void onSipReply(const AmSipReply& reply);
91 91
  
92 92
 public:
93
-  b2b_connectCalleeSession(const string& other_tag, const string& user, const string& pwd); 
93
+  b2b_connectCalleeSession(const string& other_tag, 
94
+			   AmSessionAudioConnector* connector,
95
+			   const string& user, const string& pwd); 
94 96
   ~b2b_connectCalleeSession();
95 97
 
96 98
   inline UACAuthCred* getCredentials();
... ...
@@ -149,12 +149,13 @@ void JukecallSession::process(AmEvent* event)
149 149
 }
150 150
 
151 151
 AmB2ABCalleeSession* JukecallSession::createCalleeSession() {
152
-	AmB2ABCalleeSession* sess = new JukecalleeSession(getLocalTag());
152
+  AmB2ABCalleeSession* sess = new JukecalleeSession(getLocalTag(), connector);
153 153
 	return sess;
154 154
 }
155 155
 
156
-JukecalleeSession::JukecalleeSession(const string& other_tag) 
157
-	: AmB2ABCalleeSession(other_tag)
156
+JukecalleeSession::JukecalleeSession(const string& other_tag, 
157
+				     AmSessionAudioConnector* connector) 
158
+  : AmB2ABCalleeSession(other_tag, connector)
158 159
 {
159 160
 	setDtmfDetectionEnabled(false);
160 161
 }
... ...
@@ -85,7 +85,8 @@ class JukecalleeSession
85 85
 	auto_ptr<AmAudioFile> song;
86 86
 
87 87
 public:
88
-	JukecalleeSession(const string& other_tag);
88
+  JukecalleeSession(const string& other_tag, 
89
+		    AmSessionAudioConnector* connector);
89 90
 };
90 91
  
91 92
 class JukeEvent : public AmEvent {
... ...
@@ -167,7 +167,8 @@ void ServiceLineCallerDialog::onDtmf(int event, int duration)
167 167
 }
168 168
 
169 169
 AmB2ABCalleeSession* ServiceLineCallerDialog::createCalleeSession() {
170
-  ServiceLineCalleeDialog* sess = new ServiceLineCalleeDialog(getLocalTag());
170
+  ServiceLineCalleeDialog* sess = 
171
+    new ServiceLineCalleeDialog(getLocalTag(), connector);
171 172
 
172 173
   AmSessionEventHandlerFactory* uac_auth_f = 
173 174
     AmPlugIn::instance()->getFactory4Seh("uac_auth");
... ...
@@ -190,8 +191,9 @@ AmB2ABCalleeSession* ServiceLineCallerDialog::createCalleeSession() {
190 191
 ServiceLineCalleeDialog::~ServiceLineCalleeDialog() {
191 192
 }
192 193
 
193
-ServiceLineCalleeDialog::ServiceLineCalleeDialog(const string& other_tag) 
194
-  : AmB2ABCalleeSession(other_tag),
194
+ServiceLineCalleeDialog::ServiceLineCalleeDialog(const string& other_tag, 
195
+						 AmSessionAudioConnector* connector) 
196
+  : AmB2ABCalleeSession(other_tag, connector),
195 197
     cred(ServiceLineFactory::GWAuthrealm, 
196 198
 	 ServiceLineFactory::GWAuthuser, 
197 199
 	 ServiceLineFactory::GWAuthpwd)
... ...
@@ -87,7 +87,8 @@ class ServiceLineCalleeDialog
87 87
   UACAuthCred cred;
88 88
 
89 89
 public:
90
-  ServiceLineCalleeDialog(const string& other_tag);
90
+  ServiceLineCalleeDialog(const string& other_tag, 
91
+			  AmSessionAudioConnector* connector);
91 92
   ~ServiceLineCalleeDialog();
92 93
   UACAuthCred* getCredentials();
93 94
 };
... ...
@@ -45,8 +45,8 @@ void PySemsB2ABDialog::onSessionStart(const AmSipRequest& req)
45 45
 }
46 46
 
47 47
 AmB2ABCalleeSession* PySemsB2ABDialog::createCalleeSession() {
48
-  return new PySemsB2ABCalleeDialog(getLocalTag());
49
-
48
+  return new PySemsB2ABCalleeDialog(getLocalTag(), 
49
+				    connector);
50 50
 }
51 51
 
52 52
 void PySemsB2ABDialog::process(AmEvent* event) 
... ...
@@ -62,8 +62,9 @@ struct PySemsB2ABEvent: public B2ABEvent
62 62
 class PySemsB2ABCalleeDialog : public AmB2ABCalleeSession
63 63
 {
64 64
  public:
65
- PySemsB2ABCalleeDialog(const string& other_local_tag)
66
-   : AmB2ABCalleeSession(other_local_tag) { }
65
+ PySemsB2ABCalleeDialog(const string& other_local_tag, 
66
+			AmSessionAudioConnector* connector)
67
+   : AmB2ABCalleeSession(other_local_tag, connector) { }
67 68
 
68 69
  protected:
69 70
   void onB2ABEvent(B2ABEvent* ev);
... ...
@@ -1,11 +1,11 @@
1 1
 TARGET = py_sems_lib.so
2
-OFILES = sippy_sems_libcmodule.o sippy_sems_libPySemsB2ABEvent.o sippy_sems_libPySemsB2ABCalleeDialog.o sippy_sems_libAmB2ABCalleeSession.o sippy_sems_libPySemsB2ABDialog.o sippy_sems_libPySemsB2BDialog.o sippy_sems_libPySemsDialog.o sippy_sems_libAmAudioFile.o sippy_sems_libAmAudioEvent.o sippy_sems_libAmEvent.o sippy_sems_libAmSipDialog.o sippy_sems_libAmSipReply.o sippy_sems_libAmSipRequest.o sippy_sems_libstring.o
3
-HFILES = sipAPIpy_sems_lib.h sippy_sems_libPySemsB2ABEvent.h sippy_sems_libPySemsB2ABCalleeDialog.h sippy_sems_libAmB2ABCalleeSession.h sippy_sems_libPySemsB2ABDialog.h sippy_sems_libPySemsB2BDialog.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h 
2
+OFILES = sippy_sems_libcmodule.o sippy_sems_libPySemsB2ABEvent.o sippy_sems_libPySemsB2ABCalleeDialog.o sippy_sems_libAmB2ABCalleeSession.o sippy_sems_libPySemsB2ABDialog.o sippy_sems_libAmSessionAudioConnector.o sippy_sems_libPySemsB2BDialog.o sippy_sems_libPySemsDialog.o sippy_sems_libAmAudioFile.o sippy_sems_libAmAudioEvent.o sippy_sems_libAmEvent.o sippy_sems_libAmSipDialog.o sippy_sems_libAmSipReply.o sippy_sems_libAmSipRequest.o sippy_sems_libstring.o
3
+HFILES = sipAPIpy_sems_lib.h sippy_sems_libPySemsB2ABEvent.h sippy_sems_libPySemsB2ABCalleeDialog.h sippy_sems_libAmB2ABCalleeSession.h sippy_sems_libPySemsB2ABDialog.h sippy_sems_libAmSessionAudioConnector.h sippy_sems_libPySemsB2BDialog.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h 
4 4
 
5 5
 CC = gcc
6 6
 CXX = g++
7 7
 LINK = g++
8
-CPPFLAGS = -I. -I$(COREPATH) -I/usr/include/python$(PY_VER)
8
+CPPFLAGS = -I. -I$(COREPATH) -I/usr/include/python2.5
9 9
 CFLAGS = -pipe -fPIC -O2 -w
10 10
 CXXFLAGS = -Wall -Wno-reorder -g -pipe -fPIC -O2 -w
11 11
 LFLAGS = -g -shared -Wl,--version-script=py_sems_lib.exp
... ...
@@ -35,9 +35,9 @@ $(TARGET): $(OFILES)
35 35
 $(OFILES): $(HFILES)
36 36
 
37 37
 install: $(TARGET)
38
-	@test -d $(DESTDIR)/usr/lib/python$(PY_VER)/site-packages || mkdir -p $(DESTDIR)/usr/lib/python$(PY_VER)/site-packages
39
-	cp -f $(TARGET) $(DESTDIR)/usr/lib/python$(PY_VER)/site-packages/$(TARGET)
40
-	strip $(DESTDIR)/usr/lib/python$(PY_VER)/site-packages/$(TARGET)
38
+	@test -d $(DESTDIR)/usr/lib/python2.5/site-packages || mkdir -p $(DESTDIR)/usr/lib/python2.5/site-packages
39
+	cp -f $(TARGET) $(DESTDIR)/usr/lib/python2.5/site-packages/$(TARGET)
40
+	strip $(DESTDIR)/usr/lib/python2.5/site-packages/$(TARGET)
41 41
 
42 42
 clean:
43 43
 	-rm -f $(TARGET)
... ...
@@ -46,6 +46,7 @@ clean:
46 46
 	-rm -f sippy_sems_libPySemsB2ABCalleeDialog.o
47 47
 	-rm -f sippy_sems_libAmB2ABCalleeSession.o
48 48
 	-rm -f sippy_sems_libPySemsB2ABDialog.o
49
+	-rm -f sippy_sems_libAmSessionAudioConnector.o
49 50
 	-rm -f sippy_sems_libPySemsB2BDialog.o
50 51
 	-rm -f sippy_sems_libPySemsDialog.o
51 52
 	-rm -f sippy_sems_libAmAudioFile.o
... ...
@@ -1,4 +1,23 @@
1 1
 
2
+class AmSessionAudioConnector
3
+{
4
+%TypeHeaderCode
5
+#include "../../../core/AmB2ABSession.h"
6
+%End
7
+public:
8
+	AmSessionAudioConnector();
9
+
10
+	~AmSessionAudioConnector();
11
+
12
+	void block();
13
+
14
+	void release();
15
+
16
+	void waitReleased();
17
+private:
18
+	AmSessionAudioConnector(const AmSessionAudioConnector&);
19
+};
20
+
2 21
 class PySemsB2ABDialog
3 22
 {
4 23
 %TypeHeaderCode
... ...
@@ -62,7 +81,7 @@ class AmB2ABCalleeSession
62 81
 #include "../../../core/AmB2ABSession.h"
63 82
 %End
64 83
 public:
65
-  AmB2ABCalleeSession(const string& /*other_local_tag*/);
84
+  AmB2ABCalleeSession(const string& /*other_local_tag*/, AmSessionAudioConnector* );
66 85
 
67 86
   void connectSession();
68 87
   void disconnectSession();
... ...
@@ -83,7 +102,7 @@ class PySemsB2ABCalleeDialog : AmB2ABCalleeSession
83 102
 #include "../../../core/AmB2ABSession.h"
84 103
 %End
85 104
 public:
86
-  PySemsB2ABCalleeDialog(const string& /*other_local_tag*/);
105
+  PySemsB2ABCalleeDialog(const string& /*other_local_tag*/, AmSessionAudioConnector* /* connector */);
87 106
 
88 107
 protected:
89 108
   virtual void onPyB2ABEvent(PySemsB2ABEvent* /TransferBack/);
... ...
@@ -1,3 +1,3 @@
1 1
 target = py_sems_lib
2
-sources = sippy_sems_libcmodule.cpp sippy_sems_libPySemsB2ABEvent.cpp sippy_sems_libPySemsB2ABCalleeDialog.cpp sippy_sems_libAmB2ABCalleeSession.cpp sippy_sems_libPySemsB2ABDialog.cpp sippy_sems_libPySemsB2BDialog.cpp sippy_sems_libPySemsDialog.cpp sippy_sems_libAmAudioFile.cpp sippy_sems_libAmAudioEvent.cpp sippy_sems_libAmEvent.cpp sippy_sems_libAmSipDialog.cpp sippy_sems_libAmSipReply.cpp sippy_sems_libAmSipRequest.cpp sippy_sems_libstring.cpp
3
-headers = sipAPIpy_sems_lib.h sippy_sems_libPySemsB2ABEvent.h sippy_sems_libPySemsB2ABCalleeDialog.h sippy_sems_libAmB2ABCalleeSession.h sippy_sems_libPySemsB2ABDialog.h sippy_sems_libPySemsB2BDialog.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h
2
+sources = sippy_sems_libcmodule.cpp sippy_sems_libPySemsB2ABEvent.cpp sippy_sems_libPySemsB2ABCalleeDialog.cpp sippy_sems_libAmB2ABCalleeSession.cpp sippy_sems_libPySemsB2ABDialog.cpp sippy_sems_libAmSessionAudioConnector.cpp sippy_sems_libPySemsB2BDialog.cpp sippy_sems_libPySemsDialog.cpp sippy_sems_libAmAudioFile.cpp sippy_sems_libAmAudioEvent.cpp sippy_sems_libAmEvent.cpp sippy_sems_libAmSipDialog.cpp sippy_sems_libAmSipReply.cpp sippy_sems_libAmSipRequest.cpp sippy_sems_libstring.cpp
3
+headers = sipAPIpy_sems_lib.h sippy_sems_libPySemsB2ABEvent.h sippy_sems_libPySemsB2ABCalleeDialog.h sippy_sems_libAmB2ABCalleeSession.h sippy_sems_libPySemsB2ABDialog.h sippy_sems_libAmSessionAudioConnector.h sippy_sems_libPySemsB2BDialog.h sippy_sems_libPySemsDialog.h sippy_sems_libAmAudioFile.h sippy_sems_libAmAudioEvent.h sippy_sems_libAmEvent.h sippy_sems_libAmSipDialog.h sippy_sems_libAmSipReply.h sippy_sems_libAmSipRequest.h sippy_sems_libstring.h
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Internal module API header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAPI_H
... ...
@@ -23,6 +23,7 @@
23 23
 #define sipName_PySemsB2ABCalleeDialog  sipNm_py_sems_lib_PySemsB2ABCalleeDialog
24 24
 #define sipName_AmB2ABCalleeSession  sipNm_py_sems_lib_AmB2ABCalleeSession
25 25
 #define sipName_PySemsB2ABDialog  sipNm_py_sems_lib_PySemsB2ABDialog
26
+#define sipName_AmSessionAudioConnector  sipNm_py_sems_lib_AmSessionAudioConnector
26 27
 #define sipName_PySemsB2BDialog  sipNm_py_sems_lib_PySemsB2BDialog
27 28
 #define sipName_PySemsDialog  sipNm_py_sems_lib_PySemsDialog
28 29
 #define sipName_AmAudioFile  sipNm_py_sems_lib_AmAudioFile
... ...
@@ -124,6 +125,10 @@ extern char sipNm_py_sems_lib_disconnectSession[];
124 125
 extern char sipNm_py_sems_lib_connectSession[];
125 126
 extern char sipNm_py_sems_lib_connectCallee[];
126 127
 extern char sipNm_py_sems_lib_PySemsB2ABDialog[];
128
+extern char sipNm_py_sems_lib_waitReleased[];
129
+extern char sipNm_py_sems_lib_release[];
130
+extern char sipNm_py_sems_lib_block[];
131
+extern char sipNm_py_sems_lib_AmSessionAudioConnector[];
127 132
 extern char sipNm_py_sems_lib_PySemsB2BDialog[];
128 133
 extern char sipNm_py_sems_lib_process[];
129 134
 extern char sipNm_py_sems_lib_setInOut[];
... ...
@@ -184,7 +189,6 @@ extern char sipNm_py_sems_lib_reason[];
184 189
 extern char sipNm_py_sems_lib_code[];
185 190
 extern char sipNm_py_sems_lib_AmSipReply[];
186 191
 extern char sipNm_py_sems_lib_getHeader[];
187
-extern char sipNm_py_sems_lib_key[];
188 192
 extern char sipNm_py_sems_lib_next_hop[];
189 193
 extern char sipNm_py_sems_lib_route[];
190 194
 extern char sipNm_py_sems_lib_body[];
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -126,7 +126,7 @@ static void *forceConvertTo_AmAudioEvent(PyObject *valobj,int *iserrp)
126 126
 
127 127
 
128 128
 /* Define this type's super-types. */
129
-static sipEncodedClassDef supers_AmAudioEvent[] = {{7, 255, 1}};
129
+static sipEncodedClassDef supers_AmAudioEvent[] = {{8, 255, 1}};
130 130
 
131 131
 static sipEnumMemberDef enummembers_AmAudioEvent[] = {
132 132
     {sipNm_py_sems_lib_cleared, AmAudioEvent::cleared, 1},
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAmAudioEvent_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../../../core/AmAudio.h"
12 12
 #line 13 "sippy_sems_libAmAudioEvent.h"
13 13
 
14
-#define sipClass_AmAudioEvent             sipModuleAPI_py_sems_lib.em_types[8]
14
+#define sipClass_AmAudioEvent             sipModuleAPI_py_sems_lib.em_types[9]
15 15
 #define sipCast_AmAudioEvent              sipType_py_sems_lib_AmAudioEvent.td_cast
16 16
 #define sipForceConvertTo_AmAudioEvent    sipType_py_sems_lib_AmAudioEvent.td_fcto
17 17
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAmAudioFile_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../../../core/AmAudioFile.h"
12 12
 #line 13 "sippy_sems_libAmAudioFile.h"
13 13
 
14
-#define sipClass_AmAudioFile             sipModuleAPI_py_sems_lib.em_types[6]
14
+#define sipClass_AmAudioFile             sipModuleAPI_py_sems_lib.em_types[7]
15 15
 #define sipCast_AmAudioFile              sipType_py_sems_lib_AmAudioFile.td_cast
16 16
 #define sipForceConvertTo_AmAudioFile    sipType_py_sems_lib_AmAudioFile.td_fcto
17 17
 
... ...
@@ -1,13 +1,14 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
8 8
 #include "sippy_sems_libAmB2ABCalleeSession.h"
9 9
 
10 10
 #include "sippy_sems_libstring.h"
11
+#include "sippy_sems_libAmSessionAudioConnector.h"
11 12
 #include "sippy_sems_libAmB2ABCalleeSession.h"
12 13
 #include "sippy_sems_libAmAudioFile.h"
13 14
 
... ...
@@ -189,10 +190,11 @@ static void *init_AmB2ABCalleeSession(sipWrapper *,PyObject *sipArgs,sipWrapper
189 190
     {
190 191
         const string * a0;
191 192
         int a0State = 0;
193
+        AmSessionAudioConnector * a1;
192 194
 
193
-        if (sipParseArgs(sipArgsParsed,sipArgs,"M1",sipMappedType_string,&a0,&a0State))
195
+        if (sipParseArgs(sipArgsParsed,sipArgs,"M1J@",sipMappedType_string,&a0,&a0State,sipClass_AmSessionAudioConnector,&a1))
194 196
         {
195
-            sipCpp = new AmB2ABCalleeSession(*a0);
197
+            sipCpp = new AmB2ABCalleeSession(*a0,a1);
196 198
 
197 199
             sipReleaseMappedType(const_cast<string *>(a0),sipMappedType_string,a0State);
198 200
         }
... ...
@@ -1,13 +1,13 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAmB2ABCalleeSession_h
8 8
 #define _py_sems_libAmB2ABCalleeSession_h
9 9
 
10
-#line 62 "PySemsB2ABDialog.sip"
10
+#line 81 "PySemsB2ABDialog.sip"
11 11
 #include "../../../core/AmB2ABSession.h"
12 12
 #line 13 "sippy_sems_libAmB2ABCalleeSession.h"
13 13
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAmEvent_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../../../core/AmEvent.h"
12 12
 #line 13 "sippy_sems_libAmEvent.h"
13 13
 
14
-#define sipClass_AmEvent             sipModuleAPI_py_sems_lib.em_types[7]
14
+#define sipClass_AmEvent             sipModuleAPI_py_sems_lib.em_types[8]
15 15
 #define sipCast_AmEvent              sipType_py_sems_lib_AmEvent.td_cast
16 16
 #define sipForceConvertTo_AmEvent    sipType_py_sems_lib_AmEvent.td_fcto
17 17
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAmSipDialog_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../../../core/AmSipDialog.h"
12 12
 #line 13 "sippy_sems_libAmSipDialog.h"
13 13
 
14
-#define sipClass_AmSipDialog             sipModuleAPI_py_sems_lib.em_types[9]
14
+#define sipClass_AmSipDialog             sipModuleAPI_py_sems_lib.em_types[10]
15 15
 #define sipCast_AmSipDialog              sipType_py_sems_lib_AmSipDialog.td_cast
16 16
 #define sipForceConvertTo_AmSipDialog    sipType_py_sems_lib_AmSipDialog.td_fcto
17 17
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAmSipReply_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../../../core/AmSipMsg.h"
12 12
 #line 13 "sippy_sems_libAmSipReply.h"
13 13
 
14
-#define sipClass_AmSipReply             sipModuleAPI_py_sems_lib.em_types[10]
14
+#define sipClass_AmSipReply             sipModuleAPI_py_sems_lib.em_types[11]
15 15
 #define sipCast_AmSipReply              sipType_py_sems_lib_AmSipReply.td_cast
16 16
 #define sipForceConvertTo_AmSipReply    sipType_py_sems_lib_AmSipReply.td_fcto
17 17
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -70,6 +70,7 @@ static void *init_AmSipRequest(sipWrapper *,PyObject *sipArgs,sipWrapper **,int
70 70
     return sipCpp;
71 71
 }
72 72
 
73
+
73 74
 extern "C" {static PyObject *var_AmSipRequest_next_hop(PyObject *, PyObject *);}
74 75
 static PyObject *var_AmSipRequest_next_hop(PyObject *sipSelf,PyObject *sipPy)
75 76
 {
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libAmSipRequest_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../../../core/AmSipMsg.h"
12 12
 #line 13 "sippy_sems_libAmSipRequest.h"
13 13
 
14
-#define sipClass_AmSipRequest             sipModuleAPI_py_sems_lib.em_types[11]
14
+#define sipClass_AmSipRequest             sipModuleAPI_py_sems_lib.em_types[12]
15 15
 #define sipCast_AmSipRequest              sipType_py_sems_lib_AmSipRequest.td_cast
16 16
 #define sipForceConvertTo_AmSipRequest    sipType_py_sems_lib_AmSipRequest.td_fcto
17 17
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -9,14 +9,15 @@
9 9
 
10 10
 #include "sippy_sems_libAmB2ABCalleeSession.h"
11 11
 #include "sippy_sems_libstring.h"
12
+#include "sippy_sems_libAmSessionAudioConnector.h"
12 13
 #include "sippy_sems_libPySemsB2ABCalleeDialog.h"
13 14
 #include "sippy_sems_libPySemsB2ABEvent.h"
14 15
 #include "sippy_sems_libAmAudioFile.h"
15 16
 
16 17
 
17
-sipPySemsB2ABCalleeDialog::sipPySemsB2ABCalleeDialog(const string& a0): PySemsB2ABCalleeDialog(a0), sipPySelf(0)
18
+sipPySemsB2ABCalleeDialog::sipPySemsB2ABCalleeDialog(const string& a0,AmSessionAudioConnector *a1): PySemsB2ABCalleeDialog(a0,a1), sipPySelf(0)
18 19
 {
19
-    sipTrace(SIP_TRACE_CTORS,"sipPySemsB2ABCalleeDialog::sipPySemsB2ABCalleeDialog(const string&) (this=0x%08x)\n",this);
20
+    sipTrace(SIP_TRACE_CTORS,"sipPySemsB2ABCalleeDialog::sipPySemsB2ABCalleeDialog(const string&,AmSessionAudioConnector *) (this=0x%08x)\n",this);
20 21
 
21 22
     sipCommonCtor(sipPyMethods,1);
22 23
 }
... ...
@@ -135,10 +136,11 @@ static void *init_PySemsB2ABCalleeDialog(sipWrapper *sipSelf,PyObject *sipArgs,s
135 136
     {
136 137
         const string * a0;
137 138
         int a0State = 0;
139
+        AmSessionAudioConnector * a1;
138 140
 
139
-        if (sipParseArgs(sipArgsParsed,sipArgs,"M1",sipMappedType_string,&a0,&a0State))
141
+        if (sipParseArgs(sipArgsParsed,sipArgs,"M1J@",sipMappedType_string,&a0,&a0State,sipClass_AmSessionAudioConnector,&a1))
140 142
         {
141
-            sipCpp = new sipPySemsB2ABCalleeDialog(*a0);
143
+            sipCpp = new sipPySemsB2ABCalleeDialog(*a0,a1);
142 144
 
143 145
             sipReleaseMappedType(const_cast<string *>(a0),sipMappedType_string,a0State);
144 146
         }
... ...
@@ -1,13 +1,13 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libPySemsB2ABCalleeDialog_h
8 8
 #define _py_sems_libPySemsB2ABCalleeDialog_h
9 9
 
10
-#line 82 "PySemsB2ABDialog.sip"
10
+#line 101 "PySemsB2ABDialog.sip"
11 11
 #include "../PySemsB2ABDialog.h"
12 12
 #include "../../../core/AmB2ABSession.h"
13 13
 #line 14 "sippy_sems_libPySemsB2ABCalleeDialog.h"
... ...
@@ -22,7 +22,7 @@ extern sipTypeDef sipType_py_sems_lib_PySemsB2ABCalleeDialog;
22 22
 class sipPySemsB2ABCalleeDialog : public PySemsB2ABCalleeDialog
23 23
 {
24 24
 public:
25
-    sipPySemsB2ABCalleeDialog(const string&);
25
+    sipPySemsB2ABCalleeDialog(const string&,AmSessionAudioConnector *);
26 26
     virtual ~sipPySemsB2ABCalleeDialog();
27 27
 
28 28
     /*
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -770,7 +770,7 @@ static void dealloc_PySemsB2ABDialog(sipWrapper *sipSelf)
770 770
 
771 771
     if (sipIsPyOwned(sipSelf))
772 772
     {
773
-#line 17 "PySemsB2ABDialog.sip"
773
+#line 36 "PySemsB2ABDialog.sip"
774 774
     fprintf(stderr,"------------- dealloc_PySemsB2ABDialog ----------\n");
775 775
 #line 776 "sippy_sems_libPySemsB2ABDialog.cpp"
776 776
 
... ...
@@ -1,13 +1,13 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libPySemsB2ABDialog_h
8 8
 #define _py_sems_libPySemsB2ABDialog_h
9 9
 
10
-#line 5 "PySemsB2ABDialog.sip"
10
+#line 24 "PySemsB2ABDialog.sip"
11 11
 #include "../PySemsB2ABDialog.h"
12 12
 #include "../../../core/AmB2ABSession.h"
13 13
 #line 14 "sippy_sems_libPySemsB2ABDialog.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,13 +1,13 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libPySemsB2ABEvent_h
8 8
 #define _py_sems_libPySemsB2ABEvent_h
9 9
 
10
-#line 98 "PySemsB2ABDialog.sip"
10
+#line 117 "PySemsB2ABDialog.sip"
11 11
 #include "../PySemsB2ABDialog.h"
12 12
 #line 13 "sippy_sems_libPySemsB2ABEvent.h"
13 13
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libPySemsB2BDialog_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../PySemsB2BDialog.h"
12 12
 #line 13 "sippy_sems_libPySemsB2BDialog.h"
13 13
 
14
-#define sipClass_PySemsB2BDialog             sipModuleAPI_py_sems_lib.em_types[4]
14
+#define sipClass_PySemsB2BDialog             sipModuleAPI_py_sems_lib.em_types[5]
15 15
 #define sipCast_PySemsB2BDialog              sipType_py_sems_lib_PySemsB2BDialog.td_cast
16 16
 #define sipForceConvertTo_PySemsB2BDialog    sipType_py_sems_lib_PySemsB2BDialog.td_fcto
17 17
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libPySemsDialog_h
... ...
@@ -11,7 +11,7 @@
11 11
 #include "../PySemsDialog.h"
12 12
 #line 13 "sippy_sems_libPySemsDialog.h"
13 13
 
14
-#define sipClass_PySemsDialog             sipModuleAPI_py_sems_lib.em_types[5]
14
+#define sipClass_PySemsDialog             sipModuleAPI_py_sems_lib.em_types[6]
15 15
 #define sipCast_PySemsDialog              sipType_py_sems_lib_PySemsDialog.td_cast
16 16
 #define sipForceConvertTo_PySemsDialog    sipType_py_sems_lib_PySemsDialog.td_fcto
17 17
 
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Module code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -10,6 +10,7 @@
10 10
 #include "sippy_sems_libPySemsB2ABCalleeDialog.h"
11 11
 #include "sippy_sems_libAmB2ABCalleeSession.h"
12 12
 #include "sippy_sems_libPySemsB2ABDialog.h"
13
+#include "sippy_sems_libAmSessionAudioConnector.h"
13 14
 #include "sippy_sems_libPySemsB2BDialog.h"
14 15
 #include "sippy_sems_libPySemsDialog.h"
15 16
 #include "sippy_sems_libAmAudioFile.h"
... ...
@@ -35,6 +36,10 @@ char sipNm_py_sems_lib_disconnectSession[] = "disconnectSession";
35 36
 char sipNm_py_sems_lib_connectSession[] = "connectSession";
36 37
 char sipNm_py_sems_lib_connectCallee[] = "connectCallee";
37 38
 char sipNm_py_sems_lib_PySemsB2ABDialog[] = "PySemsB2ABDialog";
39
+char sipNm_py_sems_lib_waitReleased[] = "waitReleased";
40
+char sipNm_py_sems_lib_release[] = "release";
41
+char sipNm_py_sems_lib_block[] = "block";
42
+char sipNm_py_sems_lib_AmSessionAudioConnector[] = "AmSessionAudioConnector";
38 43
 char sipNm_py_sems_lib_PySemsB2BDialog[] = "PySemsB2BDialog";
39 44
 char sipNm_py_sems_lib_process[] = "process";
40 45
 char sipNm_py_sems_lib_setInOut[] = "setInOut";
... ...
@@ -95,7 +100,6 @@ char sipNm_py_sems_lib_reason[] = "reason";
95 100
 char sipNm_py_sems_lib_code[] = "code";
96 101
 char sipNm_py_sems_lib_AmSipReply[] = "AmSipReply";
97 102
 char sipNm_py_sems_lib_getHeader[] = "getHeader";
98
-char sipNm_py_sems_lib_key[] = "key";
99 103
 char sipNm_py_sems_lib_next_hop[] = "next_hop";
100 104
 char sipNm_py_sems_lib_route[] = "route";
101 105
 char sipNm_py_sems_lib_body[] = "body";
... ...
@@ -306,7 +310,7 @@ static sipWrapperType *sipSubClass_AmEvent(void **sipCppRet)
306 310
 	else {
307 311
 		sipClass = sipClass_AmEvent;
308 312
 	}
309
-#line 310 "sippy_sems_libcmodule.cpp"
313
+#line 314 "sippy_sems_libcmodule.cpp"
310 314
 
311 315
     return sipClass;
312 316
 }
... ...
@@ -321,6 +325,7 @@ static sipWrapperType *typesTable[] = {
321 325
     (sipWrapperType *)(void *)&sipType_py_sems_lib_AmB2ABCalleeSession,
322 326
     (sipWrapperType *)(void *)&sipType_py_sems_lib_PySemsB2ABCalleeDialog,
323 327
     (sipWrapperType *)(void *)&sipType_py_sems_lib_PySemsB2ABDialog,
328
+    (sipWrapperType *)(void *)&sipType_py_sems_lib_AmSessionAudioConnector,
324 329
     (sipWrapperType *)(void *)&sipType_py_sems_lib_PySemsB2BDialog,
325 330
     (sipWrapperType *)(void *)&sipType_py_sems_lib_PySemsDialog,
326 331
     (sipWrapperType *)(void *)&sipType_py_sems_lib_AmAudioFile,
... ...
@@ -341,9 +346,9 @@ static sipMappedType *mappedTypesTable[] = {
341 346
 
342 347
 /* Define each named enum in this module. */
343 348
 static sipEnumDef enumTypesTable[] = {
344
-    {"py_sems_lib.AmAudioFile.OpenMode", NULL, 6, NULL},
345
-    {"py_sems_lib.AmAudioEvent.EventType", NULL, 8, NULL},
346
-    {"py_sems_lib.AmSipDialog.Status", NULL, 9, NULL},
349
+    {"py_sems_lib.AmAudioFile.OpenMode", NULL, 7, NULL},
350
+    {"py_sems_lib.AmAudioEvent.EventType", NULL, 9, NULL},
351
+    {"py_sems_lib.AmSipDialog.Status", NULL, 10, NULL},
347 352
 };
348 353
 
349 354
 
... ...
@@ -363,7 +368,7 @@ static sipVirtHandlerFunc virtHandlersTable[] = {
363 368
 
364 369
 /* This defines the class sub-convertors that this module defines. */
365 370
 static sipSubClassConvertorDef convertorsTable[] = {
366
-    {sipSubClass_AmEvent, {7, 255, 0}, NULL},
371
+    {sipSubClass_AmEvent, {8, 255, 0}, NULL},
367 372
     {NULL, {0, 0, 0}, NULL}
368 373
 };
369 374
 
... ...
@@ -377,7 +382,7 @@ sipExportedModuleDef sipModuleAPI_py_sems_lib = {
377 382
     0,
378 383
     NULL,
379 384
     NULL,
380
-    12,
385
+    13,
381 386
     typesTable,
382 387
     NULL,
383 388
     mappedTypesTable,
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface wrapper code.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #include "sipAPIpy_sems_lib.h"
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Interface header file.
3 3
  *
4
- * Generated by SIP 4.5.2 (4.5.2) on Tue Oct 16 13:58:18 2007
4
+ * Generated by SIP 4.5.2 (4.5.2) on Mon Dec  8 15:20:56 2008
5 5
  */
6 6
 
7 7
 #ifndef _py_sems_libstring_h
... ...
@@ -33,15 +33,13 @@
33 33
 #include <assert.h>
34 34
 
35 35
 AmB2ABSession::AmB2ABSession()
36
-  : AmSession(),
37
-    connector(NULL)
36
+  : AmSession(), connector(NULL)
38 37
 {
39 38
 }
40 39
 
41 40
 AmB2ABSession::AmB2ABSession(const string& other_local_tag)
42 41
   : other_id(other_local_tag),
43
-    AmSession(),
44
-    connector(NULL)
42
+    AmSession()
45 43
 {}
46 44
 
47 45
 
... ...
@@ -91,22 +89,20 @@ void AmB2ABSession::relayEvent(AmEvent* ev)
91 89
 
92 90
 void AmB2ABSession::connectSession()
93 91
 {
94
-    if (!connector)
95
-	return;
96
-
97
-    connector->connectSession(this);
98
-    AmMediaProcessor::instance()->addSession(this, callgroup);
92
+  if (!connector) {
93
+    DBG("error - trying to connect session, but no connector!\n");
94
+    return;
95
+  }
96
+  connector->connectSession(this);
97
+  AmMediaProcessor::instance()->addSession(this, callgroup);
99 98
 }
100 99
 
101 100
 void AmB2ABSession::disconnectSession()
102 101
 {
103
-    if (!connector)
104
-	return;
105
-
106
-    if (!connector->disconnectSession(this)){
107
-	delete connector;
108
-	connector = NULL;
109
-    }
102
+  if (!connector)
103
+    return;
104
+  
105
+  connector->disconnectSession(this);
110 106
 }
111 107
 
112 108
 void AmB2ABSession::onBye(const AmSipRequest& req) {
... ...
@@ -132,14 +128,26 @@ AmB2ABCallerSession::AmB2ABCallerSession()
132 128
   : AmB2ABSession(),
133 129
     callee_status(None)
134 130
 {
131
+  // owned by us
132
+  connector = new AmSessionAudioConnector();
135 133
 }
134
+
136 135
 AmB2ABCallerSession::~AmB2ABCallerSession()
137
-{ }
136
+{
137
+  delete connector;
138
+}
139
+
140
+void AmB2ABCallerSession::onBeforeDestroy() {
141
+  DBG("Waiting for release from callee session...\n");
142
+  connector->waitReleased();
143
+  DBG("OK, got release from callee session.\n");
144
+}
138 145
 
139 146
 void AmB2ABCallerSession::terminateOtherLeg()
140 147
 {
141 148
   if (callee_status != None)
142 149
     AmB2ABSession::terminateOtherLeg();
150
+
143 151
   callee_status = None;
144 152
 }
145 153
 
... ...
@@ -151,10 +159,25 @@ void AmB2ABCallerSession::onB2ABEvent(B2ABEvent* ev)
151 159
     callee_status = Connected;
152 160
 
153 161
     DBG("ConnectAudio event received from other leg\n");
154
-    B2ABConnectAudioEvent* ca = dynamic_cast<B2ABConnectAudioEvent*>(ev);
155
-    assert(ca);
162
+    B2ABConnectAudioEvent* ca = 
163
+      dynamic_cast<B2ABConnectAudioEvent*>(ev);
164
+    if (!ca) 
165
+      return;
166
+		
167
+    connectSession();
168
+
169
+    return;
170
+  } break;
171
+
172
+  case B2ABConnectEarlyAudio: {
173
+    callee_status = Early;
174
+
175
+    DBG("ConnectEarlyAudio event received from other leg\n");
176
+    B2ABConnectEarlyAudioEvent* ca = 
177
+      dynamic_cast<B2ABConnectEarlyAudioEvent*>(ev);
178
+    if (!ca)
179
+      return;
156 180
 		
157
-    connector = ca->connector;
158 181
     connectSession();
159 182
 
160 183
     return;
... ...
@@ -190,8 +213,8 @@ void AmB2ABCallerSession::connectCallee(const string& remote_party,
190 213
 
191 214
   B2ABConnectLegEvent* ev = new B2ABConnectLegEvent(remote_party,remote_uri,
192 215
 						    local_party,local_uri,
193
-						    getLocalTag(),
194
-						    headers);
216
+						    getLocalTag(), // callgroup
217
+						    headers);  // extra headers
195 218
 
196 219
   relayEvent(ev);
197 220
   callee_status = NoReply;
... ...
@@ -228,15 +251,28 @@ void AmB2ABCallerSession::setupCalleeSession(AmB2ABCalleeSession* callee_session
228 251
 
229 252
 AmB2ABCalleeSession* AmB2ABCallerSession::createCalleeSession()
230 253
 {
231
-  return new AmB2ABCalleeSession(getLocalTag());
254
+  return new AmB2ABCalleeSession(getLocalTag(), connector);
232 255
 }
233 256
 
234
-AmB2ABCalleeSession::AmB2ABCalleeSession(const string& other_local_tag)
235
-  : AmB2ABSession(other_local_tag)
236
-{ }
257
+AmB2ABCalleeSession::AmB2ABCalleeSession(const string& other_local_tag, 
258
+					 AmSessionAudioConnector* callers_connector)
259
+  : AmB2ABSession(other_local_tag),
260
+    is_connected(false)
261
+{ 
262
+  connector=callers_connector;
263
+  connector->block();
264
+}
237 265
 
238 266
 AmB2ABCalleeSession::~AmB2ABCalleeSession() 
239
-{ }
267
+{
268
+}
269
+
270
+void AmB2ABCalleeSession::onBeforeDestroy() {
271
+  DBG("releasing caller session.\n");
272
+  connector->release();
273
+  // now caller session is released
274
+}
275
+
240 276
 
241 277
 void AmB2ABCalleeSession::onB2ABEvent(B2ABEvent* ev)
242 278
 {
... ...
@@ -251,11 +287,11 @@ void AmB2ABCalleeSession::onB2ABEvent(B2ABEvent* ev)
251 287
 			
252 288
       dlg.remote_party = co_ev->remote_party;
253 289
       dlg.remote_uri   = co_ev->remote_uri;
254
-			
290
+
255 291
       // set outbound proxy as next hop 
256 292
       if (!AmConfig::OutboundProxy.empty()) 
257
- 	dlg.next_hop = AmConfig::OutboundProxy;
258
-
293
+	dlg.next_hop = AmConfig::OutboundProxy;
294
+			
259 295
       setCallgroup(co_ev->callgroup);
260 296
 			
261 297
       setNegotiateOnReply(true);
... ...
@@ -284,12 +320,22 @@ void AmB2ABCalleeSession::onB2ABEvent(B2ABEvent* ev)
284 320
   AmB2ABSession::onB2ABEvent(ev);
285 321
 }
286 322
 
323
+void AmB2ABCalleeSession::onEarlySessionStart(const AmSipReply& rep) {
324
+  DBG("onEarlySessionStart of callee session\n");
325
+  connectSession();
326
+  is_connected = true;
327
+  relayEvent(new B2ABConnectEarlyAudioEvent());
328
+}
329
+
330
+
287 331
 void AmB2ABCalleeSession::onSessionStart(const AmSipReply& rep) {
288 332
   DBG("onSessionStart of callee session\n");
289
-  // connect our audio
290
-  connector = new AmSessionAudioConnector();
291
-  connectSession();
292
-  relayEvent(new B2ABConnectAudioEvent(connector));
333
+  if (!is_connected) {
334
+    is_connected = true;
335
+    DBG("call connectSession\n");
336
+    connectSession();
337
+  }
338
+  relayEvent(new B2ABConnectAudioEvent());
293 339
 }
294 340
 
295 341
 void AmB2ABCalleeSession::onSipReply(const AmSipReply& rep) {
... ...
@@ -308,7 +354,6 @@ void AmB2ABCalleeSession::onSipReply(const AmSipReply& rep) {
308 354
   }
309 355
 }
310 356
 
311
-
312 357
 // ----------------------- SessionAudioConnector -----------------
313 358
 
314 359
 void AmSessionAudioConnector::connectSession(AmSession* sess) 
... ...
@@ -317,14 +362,24 @@ void AmSessionAudioConnector::connectSession(AmSession* sess)
317 362
 
318 363
     tag_mut.lock();
319 364
 
320
-    if(!connected[0]){
365
+    if (connected[0] && tag_sess[0] == tag) {
366
+      // re-connect to position 0
367
+      sess->setInOut(&audio_connectors[0],&audio_connectors[1]);
368
+    } else if (connected[1] && tag_sess[1] == tag) {
369
+      // re-connect to position 1
370
+      sess->setInOut(&audio_connectors[1],&audio_connectors[0]);
371
+    } else if(!connected[0]){
372
+      // connect to empty position 0
321 373
       connected[0] = true;
322
-      tag_sess[0] = tag;
374
+      tag_sess[0] = "";
375
+      tag_sess[0].append(tag);
323 376
       sess->setInOut(&audio_connectors[0],&audio_connectors[1]);
324 377
     }
325 378
     else if(!connected[1]){
379
+      // connect to empty position 1
326 380
       connected[1] = true;
327
-      tag_sess[1] = tag;
381
+      tag_sess[1] = "";
382
+      tag_sess[1].append(tag);
328 383
       sess->setInOut(&audio_connectors[1],&audio_connectors[0]);
329 384
     }
330 385
     else {
... ...
@@ -341,27 +396,42 @@ bool AmSessionAudioConnector::disconnectSession(AmSession* sess)
341 396
   const string& tag = sess->getLocalTag();
342 397
 
343 398
   tag_mut.lock();
344
-  if (tag_sess[0] == tag) {
399
+  if (connected[0] && (tag_sess[0] == tag)) {
345 400
     tag_sess[0].clear();
346 401
     connected[0] = false;
347 402
     sess->setInOut(NULL, NULL);
348 403
     res = connected[1];
349
-  } else if (tag_sess[1] == tag) {
404
+  } else if (connected[1] && (tag_sess[1] == tag)) {
350 405
     tag_sess[1].clear();
351 406
     connected[1] = false;
352 407
     sess->setInOut(NULL, NULL);
353 408
     res = connected[0];
354 409
   } else {
355
-    ERROR("disconnecting from wrong AmSessionAudioConnector\n");
410
+    DBG("disconnecting from wrong AmSessionAudioConnector\n");
356 411
   }
357 412
   tag_mut.unlock();
358 413
 
359 414
   return res;
360 415
 }
361 416
 
417
+/* mark as in use by not owning entity */
418
+void AmSessionAudioConnector::block() {
419
+  released.set(false);
420
+}
421
+  
422
+/* mark as released by not owning entity */
423
+void AmSessionAudioConnector::release() {
424
+  released.set(true);
425
+}
426
+
427
+/* wait until released  */
428
+void AmSessionAudioConnector::waitReleased() {
429
+  released.wait_for();
430
+}
431
+
362 432
 // ----------------------- AudioDelayBridge -----------------
363 433
 /** BRIDGE_DELAY is needed because of possible different packet sizes */ 
364
-#define BRIDGE_DELAY 30 * SYSTEM_SAMPLERATE/1000 // 30ms 
434
+#define BRIDGE_DELAY 30 * SYSTEM_SAMPLERATE/1000 // 30ms
365 435
 
366 436
 /* AudioBridge */
367 437
 AmAudioDelayBridge::AmAudioDelayBridge()
... ...
@@ -384,3 +454,5 @@ int AmAudioDelayBridge::read(unsigned int user_ts, unsigned int size) {
384 454
   sarr.read(user_ts, (short*) ((unsigned char*) samples), size >> 1); 
385 455
   return size;
386 456
 }
457
+
458
+
... ...
@@ -24,9 +24,8 @@
24 24
  * along with this program; if not, write to the Free Software 
25 25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 26
  */
27
-/** @file AmB2ABSession.h */
28
-#ifndef B2ABSession_H
29
-#define B2ABSession_H
27
+#ifndef _AM_B2ABSession_H
28
+#define _AM_B2ABSession_H
30 29
 
31 30
 #include "AmSession.h"
32 31
 #include "AmSipDialog.h"
... ...
@@ -35,11 +34,13 @@
35 34
 #include <string>
36 35
 using std::string;
37 36
 
38
-class AmAudioDelayBridge;
37
+#include <map>
38
+
39 39
 class AmSessionAudioConnector;
40 40
 
41 41
 enum { B2ABTerminateLeg, 
42 42
        B2ABConnectLeg, 
43
+       B2ABConnectEarlyAudio,
43 44
        B2ABConnectAudio,
44 45
        B2ABConnectOtherLegFailed,
45 46
        B2ABConnectOtherLegException,
... ...
@@ -54,7 +55,6 @@ struct B2ABEvent: public AmEvent
54 55
   {}
55 56
 };
56 57
 
57
-/** \brief event fired if B leg is ringing in b2ab session */
58 58
 struct B2ABOtherLegRingingEvent: public B2ABEvent
59 59
 {
60 60
   B2ABOtherLegRingingEvent()
... ...
@@ -65,12 +65,16 @@ struct B2ABOtherLegRingingEvent: public B2ABEvent
65 65
 /** \brief trigger connecting the audio in B2AB session */
66 66
 struct B2ABConnectAudioEvent: public B2ABEvent
67 67
 {
68
-  AmSessionAudioConnector* connector;
69
-  bool first;
68
+ B2ABConnectAudioEvent()
69
+    : B2ABEvent(B2ABConnectAudio)
70
+  {}
71
+};
70 72
 
71
-  B2ABConnectAudioEvent(AmSessionAudioConnector* connector)
72
-    : B2ABEvent(B2ABConnectAudio),
73
-       connector(connector)
73
+/** \brief trigger connecting the audio in B2AB session */
74
+struct B2ABConnectEarlyAudioEvent: public B2ABEvent
75
+{
76
+ B2ABConnectEarlyAudioEvent()
77
+    : B2ABEvent(B2ABConnectEarlyAudio)
74 78
   {}
75 79
 };
76 80
 
... ...
@@ -83,13 +87,13 @@ struct B2ABConnectLegEvent: public B2ABEvent
83 87
   string local_uri;
84 88
   string callgroup;
85 89
   string headers;
86
-
90
+  
87 91
   B2ABConnectLegEvent(const string& remote_party,
88 92
 		      const string& remote_uri,
89 93
 		      const string& local_party,
90 94
 		      const string& local_uri,
91 95
 		      const string& callgroup,
92
-		      const string& headers)
96
+		      const string& headers = "")
93 97
     : B2ABEvent(B2ABConnectLeg),
94 98
     remote_party(remote_party),
95 99
     remote_uri(remote_uri),
... ...
@@ -135,8 +139,12 @@ class AmB2ABSession: public AmSession
135 139
 {	
136 140
 
137 141
  protected:
142
+
138 143
   /** local tag of the other leg */
139 144
   string other_id;
145
+
146
+  /** reference to the audio connector - caution: not owned by callee dialog! */ 
147
+  AmSessionAudioConnector* connector; 
140 148
  
141 149
   /** Requests received for relaying */
142 150
   std::map<int,AmSipRequest> recvd_req;
... ...
@@ -165,9 +173,6 @@ class AmB2ABSession: public AmSession
165 173
   /** @see AmEventQueue */
166 174
   void process(AmEvent* event);
167 175
 
168
-  /** reference to the audio connector - caution: you may not delete this! */
169
-  AmSessionAudioConnector* connector;
170
-
171 176
  public:
172 177
 
173 178
   AmB2ABSession();
... ...
@@ -177,7 +182,7 @@ class AmB2ABSession: public AmSession
177 182
   void onBye(const AmSipRequest& req);
178 183
 
179 184
   /** connect audio stream to the other session */
180
-  void connectSession();
185
+  virtual void connectSession();
181 186
 
182 187
   /** reverse operation of connectSession */
183 188
   void disconnectSession();
... ...
@@ -193,6 +198,7 @@ class AmB2ABCallerSession: public AmB2ABSession
193 198
   enum CalleeStatus {
194 199
     None=0,
195 200
     NoReply,
201
+    Early,
196 202
     Ringing,
197 203
     Connected
198 204
   };
... ...
@@ -205,6 +211,7 @@ class AmB2ABCallerSession: public AmB2ABSession
205 211
 				  B2ABConnectLegEvent* ev);
206 212
 	
207 213
  protected:    
214
+
208 215
   virtual AmB2ABCalleeSession* createCalleeSession();
209 216
   void relayEvent(AmEvent* ev);
210 217
 
... ...
@@ -218,29 +225,38 @@ class AmB2ABCallerSession: public AmB2ABSession
218 225
 		     const string& remote_uri,
219 226
 		     const string& local_party,
220 227
 		     const string& local_uri,
221
-		     const string& headers="");
228
+		     const string& headers = "");
222 229
 
223 230
   // @see AmB2ABSession
224 231
   void terminateOtherLeg();
225 232
 
226 233
  protected:
227 234
   void onB2ABEvent(B2ABEvent* ev);
235
+  void onBeforeDestroy();
228 236
 };
229 237
 
230 238
 /** \brief Callee leg of a B2AB session */
231 239
 class AmB2ABCalleeSession: public AmB2ABSession
232 240
 {
241
+  bool is_connected; 
242
+
233 243
  public:
234
-  AmB2ABCalleeSession(const string& other_local_tag);
244
+  AmB2ABCalleeSession(const string& other_local_tag, 
245
+		      AmSessionAudioConnector* callers_connector);
235 246
   ~AmB2ABCalleeSession();
236 247
 
248
+  void onEarlySessionStart(const AmSipReply& rep);
237 249
   void onSessionStart(const AmSipReply& rep);
238 250
   void onSipReply(const AmSipReply& rep);	
239 251
 
240 252
  protected:
241 253
   void onB2ABEvent(B2ABEvent* ev);
254
+  void onBeforeDestroy();
255
+  AmCondition<bool>* released;
242 256
 };
243 257
 
258
+
259
+
244 260
 /**
245 261
  * \brief \ref AmAudio that connects input and output with delay
246 262
  *
... ...
@@ -267,10 +283,13 @@ class AmSessionAudioConnector {
267 283
   string tag_sess[2];
268 284
   bool connected[2];
269 285
   AmMutex tag_mut;
286
+
287
+  AmCondition<bool> released;
270 288
   
271 289
  public:
272 290
   /** create a connector, connect audio to sess */
273
-  AmSessionAudioConnector() { 
291
+  AmSessionAudioConnector() 
292
+    : released(true) {
274 293
     connected[0] = false; 
275 294
     connected[1] = false;
276 295
   }
... ...
@@ -284,8 +303,20 @@ class AmSessionAudioConnector {
284 303
    * @return whether connector is still connected after disconnect 
285 304
    */
286 305
   bool disconnectSession(AmSession* sess);
287
-};
288 306
 
307
+  /** mark as in use by entity not owning it */
308
+  void block(); 
309
+  
310
+  /** mark as released by entity not owning it */
311
+  void release(); 
312
+
313
+  /** wait until released by everyone */
314
+  void waitReleased();
315
+};
289 316
 
290 317
 #endif
291 318
 
319
+// Local Variables:
320
+// mode:C++
321
+// End:
322
+