Browse code

SBC: initializing CC modules in B leg

Václav Kubart authored on 14/08/2012 07:52:41
Showing 1 changed files
... ...
@@ -210,6 +210,11 @@ void SBCCallLeg::applyAProfile()
210 210
 
211 211
 void SBCCallLeg::applyBProfile()
212 212
 {
213
+  // CC interfaces and variables should be already "evaluated" by A leg, we just
214
+  // need to load the DI interfaces for us
215
+  if (!getCCInterfaces()) {
216
+    throw AmSession::Exception(500, SIP_REPLY_SERVER_INTERNAL_ERROR);
217
+  }
213 218
 
214 219
   if (!call_profile.contact.empty()) {
215 220
     dlg.contact_uri = SIP_HDR_COLSP(SIP_HDR_CONTACT) + call_profile.contact + CRLF;
... ...
@@ -814,16 +819,18 @@ bool SBCCallLeg::getCCInterfaces() {
814 819
 }
815 820
 
816 821
 void SBCCallLeg::onCallConnected(const AmSipReply& reply) {
817
-  m_state = BB_Connected;
822
+  if (a_leg) { // FIXME: really?
823
+    m_state = BB_Connected;
818 824
 
819
-  if (!startCallTimers())
820
-    return;
825
+    if (!startCallTimers())
826
+      return;
821 827
 
822
-  if (call_profile.cc_interfaces.size()) {
823
-    gettimeofday(&call_connect_ts, NULL);
824
-  }
828
+    if (call_profile.cc_interfaces.size()) {
829
+      gettimeofday(&call_connect_ts, NULL);
830
+    }
825 831
 
826
-  CCConnect(reply);
832
+    CCConnect(reply);
833
+  }
827 834
 }
828 835
 
829 836
 void SBCCallLeg::onCallStopped() {