Changeset 5649 for pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
- Timestamp:
- Sep 15, 2017 5:32:08 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
r5645 r5649 123 123 124 124 /////////////////////////////////////////////////////////////////////////////// 125 125 IpChangeParam::IpChangeParam() 126 { 127 pjsua_ip_change_param param; 128 pjsua_ip_change_param_default(¶m); 129 fromPj(param); 130 } 131 132 133 pjsua_ip_change_param IpChangeParam::toPj() const 134 { 135 pjsua_ip_change_param param; 136 pjsua_ip_change_param_default(¶m); 137 138 param.restart_listener = restartListener; 139 param.restart_lis_delay = restartLisDelay; 140 141 return param; 142 } 143 144 145 void IpChangeParam::fromPj(const pjsua_ip_change_param ¶m) 146 { 147 restartListener = PJ2BOOL(param.restart_listener); 148 restartLisDelay = param.restart_lis_delay; 149 } 150 151 /////////////////////////////////////////////////////////////////////////////// 126 152 UaConfig::UaConfig() 127 153 : mainThreadOnly(false) … … 1407 1433 } 1408 1434 1435 void Endpoint::on_ip_change_progress(pjsua_ip_change_op op, 1436 pj_status_t status, 1437 const pjsua_ip_change_op_info *info) 1438 { 1439 Endpoint &ep = Endpoint::instance(); 1440 OnIpChangeProgressParam param; 1441 1442 param.op = op; 1443 param.status = status; 1444 switch (op) { 1445 case PJSUA_IP_CHANGE_OP_RESTART_LIS: 1446 param.transportId = info->lis_restart.transport_id; 1447 break; 1448 case PJSUA_IP_CHANGE_OP_ACC_SHUTDOWN_TP: 1449 param.accId = info->acc_shutdown_tp.acc_id; 1450 break; 1451 case PJSUA_IP_CHANGE_OP_ACC_UPDATE_CONTACT: 1452 param.accId = info->acc_update_contact.acc_id; 1453 param.regInfo.code = info->acc_update_contact.code; 1454 param.regInfo.isRegister = 1455 PJ2BOOL(info->acc_update_contact.is_register); 1456 break; 1457 case PJSUA_IP_CHANGE_OP_ACC_HANGUP_CALLS: 1458 param.accId = info->acc_hangup_calls.acc_id; 1459 param.callId = info->acc_hangup_calls.call_id; 1460 break; 1461 case PJSUA_IP_CHANGE_OP_ACC_REINVITE_CALLS: 1462 param.accId = info->acc_reinvite_calls.acc_id; 1463 param.callId = info->acc_reinvite_calls.call_id; 1464 break; 1465 default: 1466 param.accId = PJSUA_INVALID_ID; 1467 break; 1468 } 1469 ep.onIpChangeProgress(param); 1470 } 1471 1409 1472 /////////////////////////////////////////////////////////////////////////////// 1410 1473 /* … … 1469 1532 ua_cfg.cb.on_buddy_state = &Endpoint::on_buddy_state; 1470 1533 ua_cfg.cb.on_acc_find_for_incoming = &Endpoint::on_acc_find_for_incoming; 1534 ua_cfg.cb.on_ip_change_progress = &Endpoint::on_ip_change_progress; 1471 1535 1472 1536 /* Call callbacks */ … … 1989 2053 #endif 1990 2054 } 2055 2056 void Endpoint::handleIpChange(const IpChangeParam ¶m) throw(Error) 2057 { 2058 pjsua_ip_change_param ip_change_param = param.toPj(); 2059 PJSUA2_CHECK_EXPR(pjsua_handle_ip_change(&ip_change_param)); 2060 }
Note: See TracChangeset
for help on using the changeset viewer.