pjsua_callback class final

This structure describes application callback to receive various event notification from PJSUA-API. All of these callbacks are OPTIONAL, although definitely application would want to implement some of the important callbacks (such as \a on_incoming_call).

Inheritance
Implemented types
Available extensions

Constructors

pjsua_callback()

Properties

address Pointer<T>

Available on T, provided by the StructAddress extension

The memory address of the underlying data.
no setter
hashCode int
The hash code for this object.
no setterinherited
on_acc_find_for_incoming Pointer<NativeFunction<Void Function(Pointer<pjsip_rx_data> rdata, Pointer<pjsua_acc_id> acc_id)>>
This callback can be used by application to override the account to be used to handle an incoming message. Initially, the account to be used will be calculated automatically by the library. This initial account will be used if application does not implement this callback, or application sets an invalid account upon returning from this callback.
getter/setter pair
on_buddy_evsub_state Pointer<NativeFunction<Void Function(pjsua_buddy_id buddy_id, Pointer<pjsip_evsub> sub, Pointer<pjsip_event> event)>>
Notify application when the state of client subscription session associated with a buddy has changed. Application may use this callback to retrieve more detailed information about the state changed event.
getter/setter pair
on_buddy_state Pointer<NativeFunction<Void Function(pjsua_buddy_id buddy_id)>>
Notify application when the buddy state has changed. Application may then query the buddy into to get the details.
getter/setter pair
on_call_media_event Pointer<NativeFunction<Void Function(pjsua_call_id call_id, UnsignedInt med_idx, Pointer<pjmedia_event> event)>>
Notification about media events such as video notifications. This callback will most likely be called from media threads, thus application must not perform heavy processing in this callback. Especially, application must not destroy the call or media in this callback. If application needs to perform more complex tasks to handle the event, it should post the task to another thread.
getter/setter pair
on_call_media_state Pointer<NativeFunction<Void Function(pjsua_call_id call_id)>>
Notify application when media state in the call has changed. Normal application would need to implement this callback, e.g. to connect the call's media to sound device. When ICE is used, this callback will also be called to report ICE negotiation failure. When DTLS-SRTP is used, this callback will also be called to report DTLS negotiation failure.
getter/setter pair
on_call_media_transport_state pjsua_med_tp_state_cb
This callback is called when media transport state is changed. See also #pjsua_med_tp_state_cb.
getter/setter pair
on_call_redirected Pointer<NativeFunction<Int32 Function(pjsua_call_id call_id, Pointer<pjsip_uri> target, Pointer<pjsip_event> e)>>
This callback is called when the call is about to resend the INVITE request to the specified target, following the previously received redirection response.
getter/setter pair
on_call_replace_request Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsip_rx_data> rdata, Pointer<Int> st_code, Pointer<pj_str_t> st_text)>>
Notify application about incoming INVITE with Replaces header. Application may reject the request by setting non-2xx code. See also on_call_replace_request2() callback for the version with \a pjsua_call_setting in the argument list.
getter/setter pair
on_call_replace_request2 Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsip_rx_data> rdata, Pointer<Int> st_code, Pointer<pj_str_t> st_text, Pointer<pjsua_call_setting> opt)>>
Notify application about incoming INVITE with Replaces header. Application may reject the request by setting non-2xx code.
getter/setter pair
on_call_replaced Pointer<NativeFunction<Void Function(pjsua_call_id old_call_id, pjsua_call_id new_call_id)>>
Notify application that an existing call has been replaced with a new call. This happens when PJSUA-API receives incoming INVITE request with Replaces header.
getter/setter pair
on_call_rx_offer Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjmedia_sdp_session> offer, Pointer<Void> reserved, Pointer<Int32> code, Pointer<pjsua_call_setting> opt)>>
Notify application when call has received new offer from remote (i.e. re-INVITE/UPDATE with SDP is received, or from the INVITE response in the case that the initial outgoing INVITE has no SDP). Application can decide to accept/reject the offer by setting the code (default is 200). If the offer is accepted, application can update the call setting to be applied in the answer. When this callback is not defined, the default behavior is to accept the offer using current call setting.
getter/setter pair
on_call_rx_reinvite Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjmedia_sdp_session> offer, Pointer<pjsip_rx_data> rdata, Pointer<Void> reserved, Pointer<pj_bool_t> async1, Pointer<Int32> code, Pointer<pjsua_call_setting> opt)>>
Notify application when call has received a re-INVITE with offer from the peer. It allows more fine-grained control over the response to a re-INVITE. If application sets async to PJ_TRUE, it can send the reply manually using the function #pjsua_call_answer_with_sdp(). Otherwise, by default the re-INVITE will be answered automatically after the callback returns.
getter/setter pair
on_call_sdp_created Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjmedia_sdp_session> sdp, Pointer<pj_pool_t> pool, Pointer<pjmedia_sdp_session> rem_sdp)>>
Notify application when a call has just created a local SDP (for initial or subsequent SDP offer/answer). Application can implement this callback to modify the SDP, before it is being sent and/or negotiated with remote SDP, for example to apply per account/call basis codecs priority or to add custom/proprietary SDP attributes.
getter/setter pair
on_call_state Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsip_event> e)>>
Notify application when call state has changed. Application may then query the call info to get the detail call states by calling pjsua_call_get_info() function.
getter/setter pair
on_call_transfer_request Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> dst, Pointer<Int32> code)>>
Notify application on call being transferred (i.e. REFER is received). Application can decide to accept/reject transfer request by setting the code (default is 202). When this callback is not defined, the default behavior is to accept the transfer. See also on_call_transfer_request2() callback for the version with \a pjsua_call_setting in the argument list.
getter/setter pair
on_call_transfer_request2 Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> dst, Pointer<Int32> code, Pointer<pjsua_call_setting> opt)>>
Notify application on call being transferred (i.e. REFER is received). Application can decide to accept/reject transfer request by setting the code (default is 202). When this callback is not defined, the default behavior is to accept the transfer.
getter/setter pair
on_call_transfer_status Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Int st_code, Pointer<pj_str_t> st_text, pj_bool_t final1, Pointer<pj_bool_t> p_cont)>>
Notify application of the status of previously sent call transfer request. Application can monitor the status of the call transfer request, for example to decide whether to terminate existing call.
getter/setter pair
on_call_tsx_state Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsip_transaction> tsx, Pointer<pjsip_event> e)>>
This is a general notification callback which is called whenever a transaction within the call has changed state. Application can implement this callback for example to monitor the state of outgoing requests, or to answer unhandled incoming requests (such as INFO) with a final response.
getter/setter pair
on_call_tx_offer Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<Void> reserved, Pointer<pjsua_call_setting> opt)>>
Notify application when call has received INVITE with no SDP offer. Application can update the call setting (e.g: add audio/video), or enable/disable codecs, or update other media session settings from within the callback, however, as mandated by the standard (RFC3261 section 14.2), it must ensure that the update overlaps with the existing media session (in codecs, transports, or other parameters) that require support from the peer, this is to avoid the need for the peer to reject the offer.
getter/setter pair
on_create_media_transport Pointer<NativeFunction<Pointer<pjmedia_transport> Function(pjsua_call_id call_id, UnsignedInt media_idx, Pointer<pjmedia_transport> base_tp, UnsignedInt flags)>>
This callback can be used by application to implement custom media transport adapter for the call, or to replace the media transport with something completely new altogether.
getter/setter pair
on_create_media_transport_srtp Pointer<NativeFunction<Void Function(pjsua_call_id call_id, UnsignedInt media_idx, Pointer<pjmedia_srtp_setting> srtp_opt)>>
Warning: deprecated and may be removed in future release. Application can set SRTP crypto settings (including keys) and keying methods via pjsua_srtp_opt in pjsua_config and pjsua_acc_config. See also ticket #2100.
getter/setter pair
on_dtmf_digit Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Int digit)>>
Notify application upon incoming DTMF digits using RFC 2833 payload formats. This callback will not be called if app implements \a on_dtmf_digit2() or \a on_dtmf_event().
getter/setter pair
on_dtmf_digit2 Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsua_dtmf_info> info)>>
Notify application upon incoming DTMF digits using the method specified in \a pjsua_dtmf_method. This callback will not be called if app implements \a on_dtmf_event().
getter/setter pair
on_dtmf_event Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsua_dtmf_event> event)>>
Notify application upon incoming DTMF digits using the method specified in \a pjsua_dtmf_method. Includes additional information about events received via RTP.
getter/setter pair
on_ice_transport_error Pointer<NativeFunction<Void Function(Int index, Int32 op, pj_status_t status, Pointer<Void> param)>>
This callback is called to report error in ICE media transport. Currently it is used to report TURN Refresh error.
getter/setter pair
on_incoming_call Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, pjsua_call_id call_id, Pointer<pjsip_rx_data> rdata)>>
Notify application on incoming call.
getter/setter pair
on_incoming_subscribe Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, Pointer<pjsua_srv_pres> srv_pres, pjsua_buddy_id buddy_id, Pointer<pj_str_t> from, Pointer<pjsip_rx_data> rdata, Pointer<Int32> code, Pointer<pj_str_t> reason, Pointer<pjsua_msg_data> msg_data)>>
Notification when incoming SUBSCRIBE request is received. Application may use this callback to authorize the incoming subscribe request (e.g. ask user permission if the request should be granted).
getter/setter pair
on_ip_change_progress Pointer<NativeFunction<Void Function(Int32 op, pj_status_t status, Pointer<pjsua_ip_change_op_info> info)>>
Calling #pjsua_handle_ip_change() may involve different operation. This callback is called to report the progress of each enabled operation.
getter/setter pair
on_media_event Pointer<NativeFunction<Void Function(Pointer<pjmedia_event> event)>>
Notification about media events such as video notifications. This callback will most likely be called from media threads, thus application must not perform heavy processing in this callback. If application needs to perform more complex tasks to handle the event, it should post the task to another thread.
getter/setter pair
on_mwi_info Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, Pointer<pjsua_mwi_info> mwi_info)>>
This callback is called when a NOTIFY request for message summary / message waiting indication is received.
getter/setter pair
on_mwi_state Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, Pointer<pjsip_evsub> evsub)>>
This callback is called when message waiting indication subscription state has changed. Application can then query the subscription state by calling #pjsip_evsub_get_state().
getter/setter pair
on_nat_detect Pointer<NativeFunction<Void Function(Pointer<pj_stun_nat_detect_result> res)>>
Callback when the library has finished performing NAT type detection.
getter/setter pair
on_pager Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> from, Pointer<pj_str_t> to, Pointer<pj_str_t> contact, Pointer<pj_str_t> mime_type, Pointer<pj_str_t> body)>>
Notify application on incoming pager (i.e. MESSAGE request). Argument call_id will be -1 if MESSAGE request is not related to an existing call.
getter/setter pair
on_pager2 Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> from, Pointer<pj_str_t> to, Pointer<pj_str_t> contact, Pointer<pj_str_t> mime_type, Pointer<pj_str_t> body, Pointer<pjsip_rx_data> rdata, pjsua_acc_id acc_id)>>
This is the alternative version of the \a on_pager() callback with \a pjsip_rx_data argument.
getter/setter pair
on_pager_status Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> to, Pointer<pj_str_t> body, Pointer<Void> user_data, Int32 status, Pointer<pj_str_t> reason)>>
Notify application about the delivery status of outgoing pager request. See also on_pager_status2() callback for the version with \a pjsip_rx_data in the argument list.
getter/setter pair
on_pager_status2 Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> to, Pointer<pj_str_t> body, Pointer<Void> user_data, Int32 status, Pointer<pj_str_t> reason, Pointer<pjsip_tx_data> tdata, Pointer<pjsip_rx_data> rdata, pjsua_acc_id acc_id)>>
Notify application about the delivery status of outgoing pager request.
getter/setter pair
on_reg_started Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, pj_bool_t renew)>>
Notify application when registration or unregistration has been initiated. Note that this only notifies the initial registration and unregistration. Once registration session is active, subsequent refresh will not cause this callback to be called.
getter/setter pair
on_reg_started2 Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, Pointer<pjsua_reg_info> info)>>
This is the alternative version of the \a on_reg_started() callback with \a pjsua_reg_info argument.
getter/setter pair
on_reg_state Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id)>>
Notify application when registration status has changed. Application may then query the account info to get the registration details.
getter/setter pair
on_reg_state2 Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, Pointer<pjsua_reg_info> info)>>
Notify application when registration status has changed. Application may inspect the registration info to get the registration status details.
getter/setter pair
on_rejected_incoming_call pjsua_on_rejected_incoming_call_cb
This callback will be invoked when the library implicitly rejects an incoming call.
getter/setter pair
on_snd_dev_operation Pointer<NativeFunction<pj_status_t Function(Int operation)>>
Callback when the sound device is about to be opened or closed. This callback will be called even when null sound device or no sound device is configured by the application (i.e. the #pjsua_set_null_snd_dev() and #pjsua_set_no_snd_dev() APIs). Application can use the API #pjsua_get_snd_dev() to get the info about which sound device is going to be opened/closed.
getter/setter pair
on_srv_subscribe_state Pointer<NativeFunction<Void Function(pjsua_acc_id acc_id, Pointer<pjsua_srv_pres> srv_pres, Pointer<pj_str_t> remote_uri, Int32 state, Pointer<pjsip_event> event)>>
Notification when server side subscription state has changed. This callback is optional as application normally does not need to do anything to maintain server side presence subscription.
getter/setter pair
on_stream_created Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjmedia_stream> strm, UnsignedInt stream_idx, Pointer<Pointer<pjmedia_port>> p_port)>>
Notify application when audio media session is created and before it is registered to the conference bridge. Application may return different audio media port if it has added media processing port to the stream. This media port then will be added to the conference bridge instead.
getter/setter pair
on_stream_created2 Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsua_on_stream_created_param> param)>>
Notify application when audio media session is created and before it is registered to the conference bridge. Application may return different audio media port if it has added media processing port to the stream. This media port then will be added to the conference bridge instead.
getter/setter pair
on_stream_destroyed Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjmedia_stream> strm, UnsignedInt stream_idx)>>
Notify application when audio media session has been unregistered from the conference bridge and about to be destroyed.
getter/setter pair
on_stream_precreate Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pjsua_on_stream_precreate_param> param)>>
Notify application when an audio media session is about to be created (as opposed to on_stream_created() and on_stream_created2() which are called after the session has been created). The application may change some stream info parameter values, i.e: jb_init, jb_min_pre, jb_max_pre, jb_max, use_ka, rtcp_sdes_bye_disabled, jb_discard_algo (audio), rx_event_pt (audio), codec_param->enc_fmt (video).
getter/setter pair
on_stun_resolution_complete pj_stun_resolve_cb
Calling #pjsua_init() will initiate an async process to resolve and contact each of the STUN server entries to find which is usable. This callback is called when the process is complete, and can be used by the application to start creating and registering accounts. This way, the accounts can avoid call setup delay caused by pending STUN resolution.
getter/setter pair
on_transport_state pjsip_tp_state_callback
This callback is called when transport state is changed. See also #pjsip_tp_state_callback.
getter/setter pair
on_typing Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> from, Pointer<pj_str_t> to, Pointer<pj_str_t> contact, pj_bool_t is_typing)>>
Notify application about typing indication.
getter/setter pair
on_typing2 Pointer<NativeFunction<Void Function(pjsua_call_id call_id, Pointer<pj_str_t> from, Pointer<pj_str_t> to, Pointer<pj_str_t> contact, pj_bool_t is_typing, Pointer<pjsip_rx_data> rdata, pjsua_acc_id acc_id)>>
Notify application about typing indication.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited