Confirmed users
214
edits
| Line 19: | Line 19: | ||
CCAPI_SetPeerConnection(callHandle, handle.c_str()); | CCAPI_SetPeerConnection(callHandle, handle.c_str()); | ||
} | } | ||
| Line 32: | Line 33: | ||
} | } | ||
* We need a new feature name. Set it up in <code>media/webrtc/signaling/src/sipcc/core/includes/ccapi.h</code> in <code>group_cc_feature_t</code>. | |||
* Implement the feature send which is a wrapper around a CPR send. The declaration goes in | * Implement the feature send which is a wrapper around a CPR send. The declaration goes in | ||
<code>media/webrtc/signaling/src/sipcc/include/cc_call_feature.h</code>: | <code>media/webrtc/signaling/src/sipcc/include/cc_call_feature.h</code>: | ||
cc_return_t CC_CallFeature_SetPeerConnection(cc_call_handle_t call_handle, cc_peerconnection_t | cc_return_t CC_CallFeature_SetPeerConnection(cc_call_handle_t call_handle, cc_peerconnection_t pc); | ||
* The implementation goes in <code>media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c</code>. Note that we have defined a CC_FEATURE_SETPEERCONNECTION. | * The implementation goes in <code>media/webrtc/signaling/src/sipcc/core/ccapp/cc_call_feature.c</code>. Note that we have defined a CC_FEATURE_SETPEERCONNECTION. The net effect of this is to send a msg across the message queue. | ||
cc_return_t CC_CallFeature_SetPeerConnection(cc_call_handle_t call_handle, cc_peerconnection_t | cc_return_t CC_CallFeature_SetPeerConnection(cc_call_handle_t call_handle, cc_peerconnection_t pc) { | ||
static const char fname[] = "CC_CallFeature_SetPeerConnection"; | static const char fname[] = "CC_CallFeature_SetPeerConnection"; | ||
CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), | CCAPP_DEBUG(DEB_L_C_F_PREFIX, DEB_L_C_F_PREFIX_ARGS(SIP_CC_PROV, GET_CALL_ID(call_handle), | ||
| Line 51: | Line 53: | ||
} | } | ||
* On the other end of the message queue (in ccapp), we need to handle the event. We add new code to <code>media/webrtc/signaling/src/sipcc/core/ccapp/ccprovider.c</code> in <code>processSessionEvent</code>: | |||
case CC_FEATURE_SETPEERCONNECTION: | |||
assert(strlen(data) < PC_HANDLE_SIZE); | |||
if (strlen(data) >= PC_HANDLE_SIZE) | |||
return; | |||
strncpy(data, featdata.pc.pc_handle, PC_HANDLE_SIZE - 1); | |||
cc_feature(CC_SRC_UI, call_id, (line_t)instance, | |||
CC_FEATURE_SETPEERCONNECTION, &featdata); | |||
break; | |||