The SipXEventDispatcher adds a listener to sipXtapi and then redispatches all of the sipXtapi events on its own callback.
Ideally, this should be part of sipXtapi – however, I don't want to change the behavior at this time. Also, solutions for the TODOs below are needed.
TODO:
- The S/MIME (and TLS?) code expects a return value. This should be broken into a new/different callback. Right now, that functionality is lost and I believe we will accept all certificates (return true at end of SipXEventDispatcher::EventCallBack.
- Some synchronization is required on the CALL_DESTROY (perhaps other final events). Right now, the call could be removed from sipXtapi's internal bookkeeping structures before the application has the ability to handle the event. I believe we should have some sort of "ACK" to the call final events (perhaps after it is dispatched from here) and the call should not be freed up in sipXtapi until after that ACK. Today, the call handle is freed in the fire***Event method in sipXtapiEvents.cpp.