Changeset 5185
- Timestamp:
- Oct 2, 2015 2:08:17 AM (9 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r5131 r5185 910 910 pjsip_status_code *code, 911 911 pjsua_call_setting *opt); 912 913 914 /** 915 * Notify application when call has received INVITE with no SDP offer. 916 * Application can update the call setting (e.g: add audio/video), or 917 * enable/disable codecs, or update other media session settings from 918 * within the callback, however, as mandated by the standard (RFC3261 919 * section 14.2), it must ensure that the update overlaps with the 920 * existing media session (in codecs, transports, or other parameters) 921 * that require support from the peer, this is to avoid the need for 922 * the peer to reject the offer. 923 * 924 * When this callback is not defined, the default behavior is to send 925 * SDP offer using current active media session (with all enabled codecs 926 * on each media type). 927 * 928 * @param call_id The call index. 929 * @param reserved Reserved param, currently not used. 930 * @param opt The current call setting, application can update 931 * this setting for generating the offer. 932 */ 933 void (*on_call_tx_offer)(pjsua_call_id call_id, 934 void *reserved, 935 pjsua_call_setting *opt); 936 912 937 913 938 /** -
pjproject/trunk/pjsip/include/pjsua2/call.hpp
r5165 r5185 852 852 853 853 /** 854 * This structure contains parameters for Call::onCallTxOffer() callback. 855 */ 856 struct OnCallTxOfferParam 857 { 858 /** 859 * The current call setting, application can update this setting for 860 * generating the offer. Note that application should maintain any 861 * active media to avoid the need for the peer to reject the offer. 862 */ 863 CallSetting opt; 864 }; 865 866 /** 854 867 * This structure contains parameters for Call::onCallRedirected() callback. 855 868 */ … … 1601 1614 */ 1602 1615 virtual void onCallRxOffer(OnCallRxOfferParam &prm) 1616 { PJ_UNUSED_ARG(prm); } 1617 1618 /** 1619 * Notify application when call has received INVITE with no SDP offer. 1620 * Application can update the call setting (e.g: add audio/video), or 1621 * enable/disable codecs, or update other media session settings from 1622 * within the callback, however, as mandated by the standard (RFC3261 1623 * section 14.2), it must ensure that the update overlaps with the 1624 * existing media session (in codecs, transports, or other parameters) 1625 * that require support from the peer, this is to avoid the need for 1626 * the peer to reject the offer. 1627 * 1628 * When this callback is not implemented, the default behavior is to send 1629 * SDP offer using current active media session (with all enabled codecs 1630 * on each media type). 1631 * 1632 * @param prm Callback parameter. 1633 */ 1634 virtual void onCallTxOffer(OnCallTxOfferParam &prm) 1603 1635 { PJ_UNUSED_ARG(prm); } 1604 1636 -
pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp
r5165 r5185 1359 1359 pjsip_status_code *code, 1360 1360 pjsua_call_setting *opt); 1361 static void on_call_tx_offer(pjsua_call_id call_id, 1362 void *reserved, 1363 pjsua_call_setting *opt); 1361 1364 static pjsip_redirect_op on_call_redirected(pjsua_call_id call_id, 1362 1365 const pjsip_uri *target, -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r5170 r5185 4182 4182 #endif 4183 4183 4184 if (pjsua_var.ua_cfg.cb.on_call_tx_offer) { 4185 cleanup_call_setting_flag(&call->opt); 4186 (*pjsua_var.ua_cfg.cb.on_call_tx_offer)(call->index, NULL, 4187 &call->opt); 4188 } 4189 4184 4190 /* We may need to re-initialize media before creating SDP */ 4185 if (call->med_prov_cnt == 0 ) {4191 if (call->med_prov_cnt == 0 || pjsua_var.ua_cfg.cb.on_call_tx_offer) { 4186 4192 status = apply_call_setting(call, &call->opt, NULL); 4187 4193 if (status != PJ_SUCCESS) -
pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp
r5167 r5185 1074 1074 } 1075 1075 1076 void Endpoint::on_call_tx_offer(pjsua_call_id call_id, 1077 void *reserved, 1078 pjsua_call_setting *opt) 1079 { 1080 PJ_UNUSED_ARG(reserved); 1081 1082 Call *call = Call::lookup(call_id); 1083 if (!call) { 1084 return; 1085 } 1086 1087 OnCallTxOfferParam prm; 1088 prm.opt.fromPj(*opt); 1089 1090 call->onCallTxOffer(prm); 1091 1092 *opt = prm.opt.toPj(); 1093 } 1094 1076 1095 pjsip_redirect_op Endpoint::on_call_redirected(pjsua_call_id call_id, 1077 1096 const pjsip_uri *target, … … 1273 1292 ua_cfg.cb.on_call_replaced = &Endpoint::on_call_replaced; 1274 1293 ua_cfg.cb.on_call_rx_offer = &Endpoint::on_call_rx_offer; 1294 ua_cfg.cb.on_call_tx_offer = &Endpoint::on_call_tx_offer; 1275 1295 ua_cfg.cb.on_call_redirected = &Endpoint::on_call_redirected; 1276 1296 ua_cfg.cb.on_call_media_transport_state =
Note: See TracChangeset
for help on using the changeset viewer.