Changeset 3903 for pjproject/trunk
- Timestamp:
- Dec 8, 2011 8:18:02 AM (13 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r3901 r3903 567 567 568 568 /** 569 * Call settings. 570 */ 571 typedef struct pjsua_call_setting 572 { 573 /** 574 * Bitmask of #pjsua_call_flag constants. 575 * 576 * Default: 0 577 */ 578 unsigned flag; 579 580 /** 581 * This flag controls what methods to request keyframe are allowed on 582 * the call. Value is bitmask of #pjsua_vid_req_keyframe_method. 583 */ 584 unsigned req_keyframe_method; 585 586 /** 587 * Number of simultaneous active audio streams for this call. Setting 588 * this to zero will disable audio in this call. 589 * 590 * Default: 1 591 */ 592 unsigned audio_cnt; 593 594 /** 595 * Number of simultaneous active video streams for this call. Setting 596 * this to zero will disable video in this call. 597 * 598 * Default: 1 (if video feature is enabled, otherwise it is zero) 599 */ 600 unsigned video_cnt; 601 602 } pjsua_call_setting; 603 604 605 /** 569 606 * This structure describes application callback to receive various event 570 607 * notification from PJSUA-API. All of these callbacks are OPTIONAL, … … 666 703 * by setting the code (default is 202). When this callback 667 704 * is not defined, the default behavior is to accept the 668 * transfer. 705 * transfer. See also on_call_transfer_request2() callback for 706 * the version with \a pjsua_call_setting in the argument list. 669 707 * 670 708 * @param call_id The call index. … … 677 715 const pj_str_t *dst, 678 716 pjsip_status_code *code); 717 718 /** 719 * Notify application on call being transfered (i.e. REFER is received). 720 * Application can decide to accept/reject transfer request 721 * by setting the code (default is 202). When this callback 722 * is not defined, the default behavior is to accept the 723 * transfer. 724 * 725 * @param call_id The call index. 726 * @param dst The destination where the call will be 727 * transfered to. 728 * @param code Status code to be returned for the call transfer 729 * request. On input, it contains status code 200. 730 * @param opt The current call setting, application can update 731 * this setting for the call being transfered. 732 */ 733 void (*on_call_transfer_request2)(pjsua_call_id call_id, 734 const pj_str_t *dst, 735 pjsip_status_code *code, 736 pjsua_call_setting *opt); 679 737 680 738 /** … … 704 762 * Notify application about incoming INVITE with Replaces header. 705 763 * Application may reject the request by setting non-2xx code. 764 * See also on_call_replace_request2() callback for the version 765 * with \a pjsua_call_setting in the argument list. 706 766 * 707 767 * @param call_id The call ID to be replaced. … … 715 775 int *st_code, 716 776 pj_str_t *st_text); 777 778 /** 779 * Notify application about incoming INVITE with Replaces header. 780 * Application may reject the request by setting non-2xx code. 781 * 782 * @param call_id The call ID to be replaced. 783 * @param rdata The incoming INVITE request to replace the call. 784 * @param st_code Status code to be set by application. Application 785 * should only return a final status (200-699). 786 * @param st_text Optional status text to be set by application. 787 * @param opt The current call setting, application can update 788 * this setting for the call being replaced. 789 */ 790 void (*on_call_replace_request2)(pjsua_call_id call_id, 791 pjsip_rx_data *rdata, 792 int *st_code, 793 pj_str_t *st_text, 794 pjsua_call_setting *opt); 717 795 718 796 /** … … 3405 3483 3406 3484 /** 3407 * Call settings.3408 */3409 typedef struct pjsua_call_setting3410 {3411 /**3412 * Bitmask of #pjsua_call_flag constants.3413 *3414 * Default: 03415 */3416 unsigned flag;3417 3418 /**3419 * This flag controls what methods to request keyframe are allowed on3420 * the call. Value is bitmask of #pjsua_vid_req_keyframe_method.3421 */3422 unsigned req_keyframe_method;3423 3424 /**3425 * Number of simultaneous active audio streams for this call. Setting3426 * this to zero will disable audio in this call.3427 *3428 * Default: 13429 */3430 unsigned audio_cnt;3431 3432 /**3433 * Number of simultaneous active video streams for this call. Setting3434 * this to zero will disable video in this call.3435 *3436 * Default: 1 (if video feature is enabled, otherwise it is zero)3437 */3438 unsigned video_cnt;3439 3440 } pjsua_call_setting;3441 3442 3443 /**3444 3485 * This structure describes the information and current status of a call. 3445 3486 */ … … 4067 4108 * 4068 4109 * @param call_id Call identification. 4069 * @param opt Optional call setting. 4110 * @param opt Optional call setting, if NULL, the current call 4111 * setting will remain unchanged. 4070 4112 * @param msg_data Optional message components to be sent with 4071 4113 * the request. … … 4097 4139 * 4098 4140 * @param call_id Call identification. 4099 * @param opt Optional call setting. 4141 * @param opt Optional call setting, if NULL, the current call 4142 * setting will remain unchanged. 4100 4143 * @param msg_data Optional message components to be sent with 4101 4144 * the request. -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r3901 r3903 965 965 * if it wants to. 966 966 */ 967 if (replaced_dlg != NULL && pjsua_var.ua_cfg.cb.on_call_replace_request) { 967 if (replaced_dlg != NULL && 968 (pjsua_var.ua_cfg.cb.on_call_replace_request || 969 pjsua_var.ua_cfg.cb.on_call_replace_request2)) 970 { 968 971 pjsua_call *replaced_call; 969 972 int st_code = 200; … … 973 976 replaced_call = (pjsua_call*) replaced_dlg->mod_data[pjsua_var.mod.id]; 974 977 978 /* Copy call setting from the replaced call */ 979 call->opt = replaced_call->opt; 980 975 981 /* Notify application */ 976 pjsua_var.ua_cfg.cb.on_call_replace_request(replaced_call->index, 977 rdata, &st_code, &st_text); 982 if (pjsua_var.ua_cfg.cb.on_call_replace_request) { 983 pjsua_var.ua_cfg.cb.on_call_replace_request(replaced_call->index, 984 rdata, 985 &st_code, &st_text); 986 } 987 988 if (pjsua_var.ua_cfg.cb.on_call_replace_request2) { 989 pjsua_var.ua_cfg.cb.on_call_replace_request2(replaced_call->index, 990 rdata, 991 &st_code, &st_text, 992 &call->opt); 993 } 978 994 979 995 /* Must specify final response */ … … 3875 3891 pjsip_status_code code; 3876 3892 pjsip_evsub *sub; 3893 pjsua_call_setting call_opt; 3877 3894 3878 3895 pj_log_push_indent(); … … 3911 3928 /* Notify callback */ 3912 3929 code = PJSIP_SC_ACCEPTED; 3913 if (pjsua_var.ua_cfg.cb.on_call_transfer_request) 3930 if (pjsua_var.ua_cfg.cb.on_call_transfer_request) { 3914 3931 (*pjsua_var.ua_cfg.cb.on_call_transfer_request)(existing_call->index, 3915 3932 &refer_to->hvalue, 3916 3933 &code); 3934 } 3935 3936 call_opt = existing_call->opt; 3937 if (pjsua_var.ua_cfg.cb.on_call_transfer_request2) { 3938 (*pjsua_var.ua_cfg.cb.on_call_transfer_request2)(existing_call->index, 3939 &refer_to->hvalue, 3940 &code, 3941 &call_opt); 3942 } 3917 3943 3918 3944 if (code < 200) … … 4041 4067 /* Now make the outgoing call. */ 4042 4068 tmp = pj_str(uri); 4043 status = pjsua_call_make_call(existing_call->acc_id, &tmp, 0,4069 status = pjsua_call_make_call(existing_call->acc_id, &tmp, &call_opt, 4044 4070 existing_call->user_data, &msg_data, 4045 4071 &new_call);
Note: See TracChangeset
for help on using the changeset viewer.