Changeset 5649 for pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp
- Timestamp:
- Sep 15, 2017 5:32:08 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp
r5636 r5649 319 319 int accountIndex; 320 320 }; 321 322 /** 323 * Parameter of Endpoint::handleIpChange(). 324 */ 325 struct IpChangeParam { 326 /** 327 * If set to PJ_TRUE, this will restart the transport listener. 328 * 329 * Default : PJ_TRUE 330 */ 331 bool restartListener; 332 333 /** 334 * If \a restartListener is set to PJ_TRUE, some delay might be needed 335 * for the listener to be restarted. Use this to set the delay. 336 * 337 * Default : PJSUA_TRANSPORT_RESTART_DELAY_TIME 338 */ 339 unsigned restartLisDelay; 340 public: 341 /** 342 * Constructor. 343 */ 344 IpChangeParam(); 345 346 /** 347 * Export to pjsua_ip_change_param. 348 */ 349 pjsua_ip_change_param toPj() const; 350 351 /** 352 * Convert from pjsip 353 */ 354 void fromPj(const pjsua_ip_change_param ¶m); 355 }; 356 357 /** 358 * Information of Update contact on IP change progress. 359 */ 360 struct RegProgressParam 361 { 362 /** 363 * Indicate if this is a Register or Un-Register message. 364 */ 365 bool isRegister; 366 367 /** 368 * SIP status code received. 369 */ 370 int code; 371 }; 372 373 /** 374 * Parameter of Endpoint::onIpChangeProgress(). 375 */ 376 struct OnIpChangeProgressParam 377 { 378 /** 379 * The IP change progress operation. 380 */ 381 pjsua_ip_change_op op; 382 383 /** 384 * The operation progress status. 385 */ 386 pj_status_t status; 387 388 /** 389 * Information of the transport id. This is only available when the 390 * operation is PJSUA_IP_CHANGE_OP_RESTART_LIS. 391 */ 392 TransportId transportId; 393 394 /** 395 * Information of the account id. This is only available when the 396 * operation is: 397 * - PJSUA_IP_CHANGE_OP_ACC_SHUTDOWN_TP 398 * - PJSUA_IP_CHANGE_OP_ACC_UPDATE_CONTACT 399 * - PJSUA_IP_CHANGE_OP_ACC_HANGUP_CALLS 400 * - PJSUA_IP_CHANGE_OP_ACC_REINVITE_CALLS 401 */ 402 int accId; 403 404 /** 405 * Information of the call id. This is only available when the operation is 406 * PJSUA_IP_CHANGE_OP_ACC_HANGUP_CALLS or 407 * PJSUA_IP_CHANGE_OP_ACC_REINVITE_CALLS 408 */ 409 int callId; 410 411 /** 412 * Registration information. This is only available when the operation is 413 * PJSUA_IP_CHANGE_OP_ACC_UPDATE_CONTACT 414 */ 415 RegProgressParam regInfo; 416 }; 417 321 418 322 419 ////////////////////////////////////////////////////////////////////////////// … … 1377 1474 void resetVideoCodecParam(const string &codec_id) throw(Error); 1378 1475 1476 /************************************************************************* 1477 * IP Change 1478 */ 1479 1480 /** 1481 * Inform the stack that IP address change event was detected. 1482 * The stack will: 1483 * 1. Restart the listener (this step is configurable via 1484 * \a IpChangeParam.restartListener). 1485 * 2. Shutdown the transport used by account registration (this step is 1486 * configurable via \a AccountConfig.ipChangeConfig.shutdownTp). 1487 * 3. Update contact URI by sending re-Registration (this step is 1488 * configurable via a\ AccountConfig.natConfig.contactRewriteUse and 1489 * a\ AccountConfig.natConfig.contactRewriteMethod) 1490 * 4. Hangup active calls (this step is configurable via 1491 * a\ AccountConfig.ipChangeConfig.hangupCalls) or 1492 * continue the call by sending re-INVITE 1493 * (configurable via \a AccountConfig.ipChangeConfig.reinviteFlags). 1494 * 1495 * @param param The IP change parameter, have a look at #IpChangeParam. 1496 * 1497 * @return PJ_SUCCESS on success, other on error. 1498 */ 1499 void handleIpChange(const IpChangeParam ¶m) throw(Error); 1500 1379 1501 public: 1380 1502 /* … … 1438 1560 */ 1439 1561 virtual void onSelectAccount(OnSelectAccountParam &prm) 1562 { PJ_UNUSED_ARG(prm); } 1563 1564 /** 1565 * Calling #handleIpChange() may involve different operation. This 1566 * callback is called to report the progress of each enabled operation. 1567 * 1568 * @param prm Callback parameters. 1569 * 1570 */ 1571 virtual void onIpChangeProgress(OnIpChangeProgressParam &prm) 1440 1572 { PJ_UNUSED_ARG(prm); } 1441 1573 … … 1588 1720 pjmedia_srtp_setting *srtp_opt); 1589 1721 1722 static void 1723 on_ip_change_progress(pjsua_ip_change_op op, 1724 pj_status_t status, 1725 const pjsua_ip_change_op_info *info); 1726 1590 1727 private: 1591 1728 void clearCodecInfoList(CodecInfoVector &codec_list);
Note: See TracChangeset
for help on using the changeset viewer.