/** * \fn _ics_core_release_hold() * \brief Tha? cuoc goi * \param agr1: ics_t *data * agr2: int port */ static void _ics_core_release_hold(ics_t *data) { if (current_call < 0) printf("No current call\n"); else { pjsua_call_reinvite(current_call, PJ_TRUE, NULL); } }
bool BlabbleCall::Unhold() { BlabbleAccountPtr p = CheckAndGetParent(); if (!p) return false; pj_status_t status = pjsua_call_reinvite(call_id_, PJ_TRUE, NULL); return status == PJ_SUCCESS; }
/** * \fn _ics_release_hold() * \brief Tha? cuoc goi * \param agr1: ics_t *data * agr2: int port */ static void _ics_release_hold(ics_t *data) { PJ_UNUSED_ARG(data); if (current_call < 0) SHOW_LOG(3, "No current call\n"); else { pjsua_call_reinvite(current_call, PJ_TRUE, NULL); } }
static void _ics_conference_call(ics_t *data, int call_id) { int i, max; PJ_UNUSED_ARG(data); max = pjsua_call_get_count(); SHOW_LOG(3, "Let's conference call!\n"); pjsua_call_info ci; #if 1 if ( (call_id != current_call) && pjsua_call_is_active(call_id) ) { pjsua_call_reinvite(call_id, PJ_TRUE, NULL); for (i = 0; i < max; i++) { if (pjsua_call_has_media(i) != 0) { pjsua_conf_connect(pjsua_call_get_conf_port(call_id), pjsua_call_get_conf_port(i)); pjsua_conf_connect(pjsua_call_get_conf_port(i), pjsua_call_get_conf_port(call_id)); } } } else SHOW_LOG(3, "Cannot transfer call!\n"); #endif //For test only: #if 1 for (i = 0; i < max; i++){ if (pjsua_call_is_active(i) && (i != current_call)) { pjsua_call_reinvite(i, PJ_TRUE, NULL); pjsua_call_get_info(i, &ci); pjsua_conf_connect(pjsua_call_get_conf_port(ci.id), pjsua_call_get_conf_port(current_call)); pjsua_conf_connect(pjsua_call_get_conf_port(current_call), pjsua_call_get_conf_port(ci.id)); } break; } #endif }
void MessagesDlg::OnBnClickedHold() { MessagesContact* messagesContactSelected = GetMessageContact(); if (messagesContactSelected->callId!=-1) { pjsua_call_info info; pjsua_call_get_info(messagesContactSelected->callId,&info); if (info.media_cnt>0) { if (info.media_status == PJSUA_CALL_MEDIA_LOCAL_HOLD || info.media_status == PJSUA_CALL_MEDIA_NONE) { pjsua_call_reinvite(messagesContactSelected->callId, PJSUA_CALL_UNHOLD, NULL); } else { pjsua_call_set_hold(messagesContactSelected->callId, NULL); } } } }
static void update_active_calls(const pj_str_t *new_ip_addr) { pjsip_tpselector tp_sel; pjsua_init_tpselector(0, &tp_sel); // << 0 is hard coded here for active transportId. could be passed in if needed. int ndx; for (ndx = 0; ndx < pjsua_var.ua_cfg.max_calls; ++ndx) { pjsua_call *call = &pjsua_var.calls[ndx]; if (!call->inv || call->inv->state != PJSIP_INV_STATE_CONFIRMED) { continue; } // -- TODO : we should do something here about transport, // but something that actually restart media transport for this call // cause copying ip addr somewhere is not valid for stun and nat cases //transport_set_sdp_addr_from_string(call->med_orig, new_ip_addr); //transport_set_sdp_addr_from_string(call->med_tp, new_ip_addr); if (call->local_hold) { pjsua_call_set_hold(ndx, NULL); } else { pjsua_call_reinvite(ndx, PJ_TRUE, NULL); } } }