void SipDialogMonitor::notifyEventCallback(const char* earlyDialogHandle, const char* dialogHandle, void* applicationData, const SipMessage* notifyRequest) { // Receive the notification and process the message SipDialogMonitor* pThis = (SipDialogMonitor *) applicationData; pThis->handleNotifyMessage(notifyRequest); }
// Callback to handle incoming NOTIFYs. bool SipDialogMonitor::notifyEventCallback(const char* earlyDialogHandle, const char* dialogHandle, void* applicationData, const SipMessage* notifyRequest) { // Receive the notification and process the message // Our SipdialogMonitor is pointed to by the applicationData. SipDialogMonitor* pThis = (SipDialogMonitor *) applicationData; pThis->handleNotifyMessage(notifyRequest, earlyDialogHandle, dialogHandle); return true; }
bool AddExtension::execute(const HttpRequestContext& requestContext, UtlSList& params, void* userData, XmlRpcResponse& response, XmlRpcMethod::ExecutionStatus& status) { bool result = false; int totalParams = params.entries(); if (totalParams > 2) { response.setFault(TOO_MANY_PARAMS_FAULT_CODE, TOO_MANY_PARAMS_FAULT_STRING); result = false; } else { UtlString groupName; UtlString extension; for (int index = 0; index < totalParams; index++) { UtlContainable *value = params.at(index); if (index == 0 || index == 1) { UtlString paramType(value->getContainableType()); if (paramType.compareTo("UtlString") == 0) { if (index == 0) { groupName = *((UtlString *)value); } else { extension = *((UtlString *)value); } result = true; } else { response.setFault(ILLEGAL_PARAM_FAULT_CODE, ILLEGAL_PARAM_FAULT_STRING); result = false; } } } if (result) { SipDialogMonitor* dialogMonitor = (SipDialogMonitor *) userData; Url extensionUrl(extension); dialogMonitor->addExtension(groupName, extensionUrl); status = XmlRpcMethod::OK; // Construct the response UtlString responseText("method call \"addExtension\" successful"); response.setResponse(&responseText); } } return true; }