Browse code

SBC: support for serial fork in CC interface

Václav Kubart authored on 04/10/2012 13:05:36
Showing 3 changed files
... ...
@@ -43,6 +43,10 @@ class ExtendedCCInterface
43 43
     /** called when the call leg is being destroyed, useful to cleanup used resources */
44 44
     virtual void onDestroyLeg(SBCCallLeg *call) { }
45 45
 
46
+    /** one of existing B legs is refused,
47
+     * handle redirect here or do serial fork or ... */
48
+    virtual CCChainProcessing onBLegRefused(SBCCallLeg *call, const AmSipReply& reply) { return ContinueProcessing; }
49
+
46 50
     // dialog state changes
47 51
     // TODO
48 52
 
... ...
@@ -1212,6 +1212,13 @@ void SBCCallLeg::onCallStatusChange()
1212 1212
   }
1213 1213
 }
1214 1214
 
1215
+void SBCCallLeg::onBLegRefused(const AmSipReply& reply)
1216
+{
1217
+  for (vector<ExtendedCCInterface*>::iterator i = cc_ext.begin(); i != cc_ext.end(); ++i) {
1218
+    if ((*i)->onBLegRefused(this, reply) == StopProcessing) return;
1219
+  }
1220
+}
1221
+
1215 1222
 //////////////////////////////////////////////////////////////////////////////////////////
1216 1223
 // body filtering
1217 1224
 
... ...
@@ -96,6 +96,7 @@ class SBCCallLeg : public CallLeg, public CredentialHolder
96 96
   void applyBProfile();
97 97
 
98 98
   virtual void onCallStatusChange();
99
+  virtual void onBLegRefused(const AmSipReply& reply);
99 100
 
100 101
  public:
101 102