Event Handlers
Signaling and application implement event handler callbacks to process eventsfrom each other. Application implemented callback is provided tosignaling in configuration structure passed to ippInitMessaging().
Please note that an outgoing call should be initiated using functionalinterface i.e. ippStartCall(). All subsequent events shall bereported to application by calling application callback. All reportedevents are accompanied by call context making it possible to maintainstates of multiple calls.
Eventhandler callback implemented by application
This callback should be implemented by application to listen toasynchronous events from signaling module.
Include
ippapi.h
Prototype
typedefvoid (*EVENT_HANDLER_CB)(void *iface, UInt32 event, UInt32 context,void *args)
Parameters
iface: Pointer to structure containing pointer to callbacks
to process application events. Should be type casted
to pIPPConfig to report events to signaling callback
event: Event to report (see below for event details)
context: Callcontext the event should be processed in
args: Eventspecific parameters
Returns
None
Signaling events (to application)
| Event type | Arguments | Description |
|---|---|---|
| SIG2UI_EV_CALL_ESTABLISHED | None | Call is established |
| SIG2UI_EV_INCOMING_CALL | Caller ID | New incoming call |
| SIG2UI_EV_ERROR | None | Error in response to a previous request |
| SIG2UI_EV_BUSY | None | Called number is busy |
| SIG2UI_EV_RINGBACK | None | Call in progress |
| SIG2UI_EV_HANGUP | None | Remote party hungup |
| SIG2UI_EV_REGISTERED | None | Registered with server |
| SIG2UI_EV_DEREGISTERED | None | De-registered from server |
| SIG2UI_EV_END_SESSION | None | Call session is not longer valid |
| SIG2UI_EV__IM | Pointer to message string | Incoming instance message (IM) |
Eventhandler callback implemented by signaling
The callback is implemented by signaling and passed on to application infirst parameter to application callback invocation which is datastructure of following type:
typedefstruct ipp\_interface\_t {
UInt32(\*eventHandler)(UInt32 event, UInt32 \*context, void \*args);
} IPPInterface, \*pIPPInterface;
Include
ippapi.h
Prototype
UInt32(*eventHandler)(UInt32 event, UInt32 *context, void *args)
Parameters
event: Event to report (see below for event details)
context: Call context the event should be processed in
args: Event specific parameters
Returns
None
Application events (to signaling)
| Event type | Arguments | Description |
|---|---|---|
| UI2SIG_EV_NEW | Called number/URI | To initiate a new call. ippStartCall() prefered instead |
| UI2SIG_EV_HANGUP | None | Hangup call on a specified context |
| UI2SIG_EV_ANSWER | None | Incoming call has been accepted |
| UI2SIG_EV_REJECT | None | Incoming call has been rejected |
| UI2SIG_EV_START_VOICE | None | Start media streaming for a newly accepted call |
| UI2SIG_EV_HOLD | None | Put specified call on hold (media streaming will pause) |
| UI2SIG_EV_UNHOLD | None | Take a call out of hold |
| UI2SIG_EV_SEND_DTMF | None | Send DTMF digit |
| UI2SIG_EV_SEND_IM | None | Send instance message |