1 #ifndef _SBCCallControlAPI_h_ 2 #define _SBCCallControlAPI_h_ 3 4 #include "AmEvent.h" 5 6 #define CC_INTERFACE_MAND_VALUES_METHOD "getMandatoryValues" 7 8 9 #define CC_API_PARAMS_CC_NAMESPACE 0 10 #define CC_API_PARAMS_LTAG 1 11 #define CC_API_PARAMS_CALL_PROFILE 2 12 #define CC_API_PARAMS_SIP_MSG 3 13 #define CC_API_PARAMS_TIMESTAMPS 4 14 15 #define CC_API_PARAMS_CFGVALUES 5 16 #define CC_API_PARAMS_TIMERID 6 17 18 #define CC_API_PARAMS_OTHERID 5 19 20 #define CC_API_TS_START_SEC 0 21 #define CC_API_TS_START_USEC 1 22 #define CC_API_TS_CONNECT_SEC 2 23 #define CC_API_TS_CONNECT_USEC 3 24 #define CC_API_TS_END_SEC 4 25 #define CC_API_TS_END_USEC 5 26 27 #define SBC_CC_DROP_ACTION 0 28 #define SBC_CC_REFUSE_ACTION 1 29 #define SBC_CC_SET_CALL_TIMER_ACTION 2 30 31 #define SBC_CC_REPL_SET_GLOBAL_ACTION 10 32 #define SBC_CC_REPL_REMOVE_GLOBAL_ACTION 11 33 34 // index in action parameter: 35 #define SBC_CC_ACTION 0 36 37 // refuse with 38 #define SBC_CC_REFUSE_CODE 1 39 #define SBC_CC_REFUSE_REASON 2 40 #define SBC_CC_REFUSE_HEADERS 3 41 42 // set timer 43 #define SBC_CC_TIMER_TIMEOUT 1 44 45 // set/remove globals 46 #define SBC_CC_REPL_SET_GLOBAL_SCOPE 1 47 #define SBC_CC_REPL_SET_GLOBAL_NAME 2 48 #define SBC_CC_REPL_SET_GLOBAL_VALUE 3 49 50 /** post an SBCCallTimerEvent to an SBC call in order to set or reset call timer */ 51 #define SBCCallTimerEvent_ID -563 52 struct SBCCallTimerEvent : public AmEvent { 53 enum TimerAction { 54 Remove = 0, 55 Set, 56 Reset 57 }; 58 59 TimerAction timer_action; 60 double timeout; 61 int timer_id; 62 63 SBCCallTimerEvent(TimerAction timer_action, int timer_id, double timeout = 0) AmEventSBCCallTimerEvent64 : AmEvent(SBCCallTimerEvent_ID), 65 timer_action(timer_action), timeout(timeout), timer_id(timer_id) { } 66 }; 67 68 #define SBCControlEvent_ID -564 69 struct SBCControlEvent : public AmEvent { 70 string cmd; 71 AmArg params; 72 SBCControlEventSBCControlEvent73 SBCControlEvent(const string& cmd, const AmArg& params) 74 : AmEvent(SBCControlEvent_ID), cmd(cmd), params(params) { } 75 SBCControlEventSBCControlEvent76 SBCControlEvent(const string& cmd) 77 : AmEvent(SBCControlEvent_ID), cmd(cmd) { } 78 79 }; 80 81 #endif 82