Browse code

SBC: preserve original behavior of the CC interface

All existing methods (connect/start/end) should be called for A leg only.

Václav Kubart authored on 14/08/2012 06:25:06
Showing 1 changed files
... ...
@@ -927,6 +927,8 @@ void SBCCallLeg::stopCallTimers() {
927 927
 }
928 928
 
929 929
 bool SBCCallLeg::CCStart(const AmSipRequest& req) {
930
+  if (!a_leg) return true; // preserve original behavior of the CC interface
931
+
930 932
   vector<AmDynInvoke*>::iterator cc_mod=cc_modules.begin();
931 933
 
932 934
   for (CCInterfaceListIteratorT cc_it=call_profile.cc_interfaces.begin();
... ...
@@ -1076,6 +1078,8 @@ bool SBCCallLeg::CCStart(const AmSipRequest& req) {
1076 1078
 }
1077 1079
 
1078 1080
 void SBCCallLeg::CCConnect(const AmSipReply& reply) {
1081
+  if (!a_leg) return; // preserve original behavior of the CC interface
1082
+
1079 1083
   vector<AmDynInvoke*>::iterator cc_mod=cc_modules.begin();
1080 1084
 
1081 1085
   for (CCInterfaceListIteratorT cc_it=call_profile.cc_interfaces.begin();
... ...
@@ -1123,11 +1127,9 @@ void SBCCallLeg::CCEnd() {
1123 1127
 }
1124 1128
 
1125 1129
 void SBCCallLeg::CCEnd(const CCInterfaceListIteratorT& end_interface) {
1130
+  if (!a_leg) return; // preserve original behavior of the CC interface
1131
+
1126 1132
   vector<AmDynInvoke*>::iterator cc_mod=cc_modules.begin();
1127
-  if (cc_mod == cc_modules.end()) {
1128
-    // FIXME: callee has not the modules (only in the call_profile!)
1129
-    return;
1130
-  }
1131 1133
 
1132 1134
   for (CCInterfaceListIteratorT cc_it=call_profile.cc_interfaces.begin();
1133 1135
        cc_it != end_interface; cc_it++) {