WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

#include <call.hpp>

Public Member Functions

 Call (Account &acc, int call_id=PJSUA_INVALID_ID)
 
virtual ~Call ()
 
CallInfo getInfo () const throw (Error)
 
bool isActive () const
 
int getId () const
 
bool hasMedia () const
 
MediagetMedia (unsigned med_idx) const
 
AudioMedia getAudioMedia (int med_idx) const throw (Error)
 
VideoMedia getEncodingVideoMedia (int med_idx) const throw (Error)
 
VideoMedia getDecodingVideoMedia (int med_idx) const throw (Error)
 
pjsip_dialog_cap_status remoteHasCap (int htype, const string &hname, const string &token) const
 
void setUserData (Token user_data)
 
Token getUserData () const
 
pj_stun_nat_type getRemNatType () throw (Error)
 
void makeCall (const string &dst_uri, const CallOpParam &prm) throw (Error)
 
void answer (const CallOpParam &prm) throw (Error)
 
void hangup (const CallOpParam &prm) throw (Error)
 
void setHold (const CallOpParam &prm) throw (Error)
 
void reinvite (const CallOpParam &prm) throw (Error)
 
void update (const CallOpParam &prm) throw (Error)
 
void xfer (const string &dest, const CallOpParam &prm) throw (Error)
 
void xferReplaces (const Call &dest_call, const CallOpParam &prm) throw (Error)
 
void processRedirect (pjsip_redirect_op cmd) throw (Error)
 
void dialDtmf (const string &digits) throw (Error)
 
void sendDtmf (const CallSendDtmfParam &param) throw (Error)
 
void sendInstantMessage (const SendInstantMessageParam &prm) throw (Error)
 
void sendTypingIndication (const SendTypingIndicationParam &prm) throw (Error)
 
void sendRequest (const CallSendRequestParam &prm) throw (Error)
 
string dump (bool with_media, const string indent) throw (Error)
 
int vidGetStreamIdx () const
 
bool vidStreamIsRunning (int med_idx, pjmedia_dir dir) const
 
void vidSetStream (pjsua_call_vid_strm_op op, const CallVidSetStreamParam &param) throw (Error)
 
void audStreamModifyCodecParam (int med_idx, const CodecParam &param) throw (Error)
 
StreamInfo getStreamInfo (unsigned med_idx) const throw (Error)
 
StreamStat getStreamStat (unsigned med_idx) const throw (Error)
 
MediaTransportInfo getMedTransportInfo (unsigned med_idx) const throw (Error)
 
void processMediaUpdate (OnCallMediaStateParam &prm)
 
void processStateChange (OnCallStateParam &prm)
 
virtual void onCallState (OnCallStateParam &prm)
 
virtual void onCallTsxState (OnCallTsxStateParam &prm)
 
virtual void onCallMediaState (OnCallMediaStateParam &prm)
 
virtual void onCallSdpCreated (OnCallSdpCreatedParam &prm)
 
virtual void onStreamPreCreate (OnStreamPreCreateParam &prm)
 
virtual void onStreamCreated (OnStreamCreatedParam &prm)
 
virtual void onStreamDestroyed (OnStreamDestroyedParam &prm)
 
virtual void onDtmfDigit (OnDtmfDigitParam &prm)
 
virtual void onDtmfEvent (OnDtmfEventParam &prm)
 
virtual void onCallTransferRequest (OnCallTransferRequestParam &prm)
 
virtual void onCallTransferStatus (OnCallTransferStatusParam &prm)
 
virtual void onCallReplaceRequest (OnCallReplaceRequestParam &prm)
 
virtual void onCallReplaced (OnCallReplacedParam &prm)
 
virtual void onCallRxOffer (OnCallRxOfferParam &prm)
 
virtual void onCallRxReinvite (OnCallRxReinviteParam &prm)
 
virtual void onCallTxOffer (OnCallTxOfferParam &prm)
 
virtual void onInstantMessage (OnInstantMessageParam &prm)
 
virtual void onInstantMessageStatus (OnInstantMessageStatusParam &prm)
 
virtual void onTypingIndication (OnTypingIndicationParam &prm)
 
virtual pjsip_redirect_op onCallRedirected (OnCallRedirectedParam &prm)
 
virtual void onCallMediaTransportState (OnCallMediaTransportStateParam &prm)
 
virtual void onCallMediaEvent (OnCallMediaEventParam &prm)
 
virtual void onCreateMediaTransport (OnCreateMediaTransportParam &prm)
 
virtual void onCreateMediaTransportSrtp (OnCreateMediaTransportSrtpParam &prm)
 

Static Public Member Functions

static Calllookup (int call_id)
 

Friends

class Endpoint
 

Detailed Description

Constructor & Destructor Documentation

◆ Call()

pj::Call::Call ( Account acc,
int  call_id = PJSUA_INVALID_ID 
)

Constructor.

◆ ~Call()

virtual pj::Call::~Call ( )
virtual

Destructor.

Member Function Documentation

◆ getInfo()

CallInfo pj::Call::getInfo ( ) const
throw (Error
)

Obtain detail information about this call.

Returns
Call info.

◆ isActive()

bool pj::Call::isActive ( ) const

Check if this call has active INVITE session and the INVITE session has not been disconnected.

Returns
True if call is active.

◆ getId()

int pj::Call::getId ( ) const

Get PJSUA-LIB call ID or index associated with this call.

Returns
Integer greater than or equal to zero.

◆ lookup()

static Call * pj::Call::lookup ( int  call_id)
static

Get the Call class for the specified call Id.

Parameters
call_idThe call ID to lookup
Returns
The Call instance or NULL if not found.

◆ hasMedia()

bool pj::Call::hasMedia ( ) const

Check if call has an active media session.

Returns
True if yes.

◆ getMedia()

Media * pj::Call::getMedia ( unsigned  med_idx) const

Warning: deprecated, use getAudioMedia() instead. This function is not safe in multithreaded environment.

Get media for the specified media index.

Parameters
med_idxMedia index.
Returns
The media or NULL if invalid or inactive.

◆ getAudioMedia()

AudioMedia pj::Call::getAudioMedia ( int  med_idx) const
throw (Error
)

Get audio media for the specified media index. If the specified media index is not audio or invalid or inactive, exception will be thrown.

Parameters
med_idxMedia index, or -1 to specify any first audio media registered in the conference bridge.
Returns
The audio media.

◆ getEncodingVideoMedia()

VideoMedia pj::Call::getEncodingVideoMedia ( int  med_idx) const
throw (Error
)

Get video media in encoding direction for the specified media index. If the specified media index is not video or invalid or the direction is receive only, exception will be thrown.

Parameters
med_idxMedia index, or -1 to specify any first video media with encoding direction registered in the conference bridge.
Returns
The video media.

◆ getDecodingVideoMedia()

VideoMedia pj::Call::getDecodingVideoMedia ( int  med_idx) const
throw (Error
)

Get video media in decoding direction for the specified media index. If the specified media index is not video or invalid or the direction is send only, exception will be thrown.

Parameters
med_idxMedia index, or -1 to specify any first video media with decoding direction registered in the conference bridge.
Returns
The video media.

◆ remoteHasCap()

pjsip_dialog_cap_status pj::Call::remoteHasCap ( int  htype,
const string &  hname,
const string &  token 
) const

Check if remote peer support the specified capability.

Parameters
htypeThe header type (pjsip_hdr_e) to be checked, which value may be:
  • PJSIP_H_ACCEPT
  • PJSIP_H_ALLOW
  • PJSIP_H_SUPPORTED
hnameIf htype specifies PJSIP_H_OTHER, then the header name must be supplied in this argument. Otherwise the value must be set to empty string ("").
tokenThe capability token to check. For example, if htype is PJSIP_H_ALLOW, then token specifies the method names; if htype is PJSIP_H_SUPPORTED, then token specifies the extension names such as "100rel".
Returns
PJSIP_DIALOG_CAP_SUPPORTED if the specified capability is explicitly supported, see pjsip_dialog_cap_status for more info.

◆ setUserData()

void pj::Call::setUserData ( Token  user_data)

Attach application specific data to the call. Application can then inspect this data by calling getUserData().

Parameters
user_dataArbitrary data to be attached to the call.

◆ getUserData()

Token pj::Call::getUserData ( ) const

Get user data attached to the call, which has been previously set with setUserData().

Returns
The user data.

◆ getRemNatType()

pj_stun_nat_type pj::Call::getRemNatType ( )
throw (Error
)

Get the NAT type of remote's endpoint. This is a proprietary feature of PJSUA-LIB which sends its NAT type in the SDP when natTypeInSdp is set in UaConfig.

This function can only be called after SDP has been received from remote, which means for incoming call, this function can be called as soon as call is received as long as incoming call contains SDP, and for outgoing call, this function can be called only after SDP is received (normally in 200/OK response to INVITE). As a general case, application should call this function after or in onCallMediaState() callback.

Returns
The NAT type.
See also
Endpoint::natGetType(), natTypeInSdp

◆ makeCall()

void pj::Call::makeCall ( const string &  dst_uri,
const CallOpParam prm 
)
throw (Error
)

Make outgoing call to the specified URI.

Parameters
dst_uriURI to be put in the To header (normally is the same as the target URI).
prm.optOptional call setting.
prm.txOptionOptional headers etc to be added to outgoing INVITE request.

◆ answer()

void pj::Call::answer ( const CallOpParam prm)
throw (Error
)

Send response to incoming INVITE request with call setting param. Depending on the status code specified as parameter, this function may send provisional response, establish the call, or terminate the call. Notes about call setting:

  • if call setting is changed in the subsequent call to this function, only the first call setting supplied will applied. So normally application will not supply call setting before getting confirmation from the user.
  • if no call setting is supplied when SDP has to be sent, i.e: answer with status code 183 or 2xx, the default call setting will be used, check CallSetting for its default values.
Parameters
prm.optOptional call setting.
prm.statusCodeStatus code, (100-699).
prm.reasonOptional reason phrase. If empty, default text will be used.
prm.txOptionOptional list of headers etc to be added to outgoing response message. Note that this message data will be persistent in all next answers/responses for this INVITE request.

◆ hangup()

void pj::Call::hangup ( const CallOpParam prm)
throw (Error
)

Hangup call by using method that is appropriate according to the call state. This function is different than answering the call with 3xx-6xx response (with answer()), in that this function will hangup the call regardless of the state and role of the call, while answer() only works with incoming calls on EARLY state.

Parameters
prm.statusCodeOptional status code to be sent when we're rejecting incoming call. If the value is zero, "603/Decline" will be sent.
prm.reasonOptional reason phrase to be sent when we're rejecting incoming call. If empty, default text will be used.
prm.txOptionOptional list of headers etc to be added to outgoing request/response message.

◆ setHold()

void pj::Call::setHold ( const CallOpParam prm)
throw (Error
)

Put the specified call on hold. This will send re-INVITE with the appropriate SDP to inform remote that the call is being put on hold. The final status of the request itself will be reported on the onCallMediaState() callback, which inform the application that the media state of the call has changed.

Parameters
prm.optionsBitmask of pjsua_call_flag constants. Currently, only the flag PJSUA_CALL_UPDATE_CONTACT can be used.
prm.txOptionOptional message components to be sent with the request.

◆ reinvite()

void pj::Call::reinvite ( const CallOpParam prm)
throw (Error
)

Send re-INVITE. The final status of the request itself will be reported on the onCallMediaState() callback, which inform the application that the media state of the call has changed.

Parameters
prm.optOptional call setting, if empty, the current call setting will remain unchanged.
prm.opt.flagBitmask of pjsua_call_flag constants. Specifying PJSUA_CALL_UNHOLD here will release call hold.
prm.txOptionOptional message components to be sent with the request.

◆ update()

void pj::Call::update ( const CallOpParam prm)
throw (Error
)

Send UPDATE request.

Parameters
prm.optOptional call setting, if empty, the current call setting will remain unchanged.
prm.txOptionOptional message components to be sent with the request.

◆ xfer()

void pj::Call::xfer ( const string &  dest,
const CallOpParam prm 
)
throw (Error
)

Initiate call transfer to the specified address. This function will send REFER request to instruct remote call party to initiate a new INVITE session to the specified destination/target.

If application is interested to monitor the successfulness and the progress of the transfer request, it can implement onCallTransferStatus() callback which will report the progress of the call transfer request.

Parameters
destURI of new target to be contacted. The URI may be in name address or addr-spec format.
prm.txOptionOptional message components to be sent with the request.

◆ xferReplaces()

void pj::Call::xferReplaces ( const Call dest_call,
const CallOpParam prm 
)
throw (Error
)

Initiate attended call transfer. This function will send REFER request to instruct remote call party to initiate new INVITE session to the URL of destCall. The party at dest_call then should "replace" the call with us with the new call from the REFER recipient.

Parameters
dest_callThe call to be replaced.
prm.optionsApplication may specify PJSUA_XFER_NO_REQUIRE_REPLACES to suppress the inclusion of "Require: replaces" in the outgoing INVITE request created by the REFER request.
prm.txOptionOptional message components to be sent with the request.

◆ processRedirect()

void pj::Call::processRedirect ( pjsip_redirect_op  cmd)
throw (Error
)

Accept or reject redirection response. Application MUST call this function after it signaled PJSIP_REDIRECT_PENDING in the onCallRedirected() callback, to notify the call whether to accept or reject the redirection to the current target. Application can use the combination of PJSIP_REDIRECT_PENDING command in onCallRedirected() callback and this function to ask for user permission before redirecting the call.

Note that if the application chooses to reject or stop redirection (by using PJSIP_REDIRECT_REJECT or PJSIP_REDIRECT_STOP respectively), the call disconnection callback will be called before this function returns. And if the application rejects the target, the onCallRedirected() callback may also be called before this function returns if there is another target to try.

Parameters
cmdRedirection operation to be applied to the current target. The semantic of this argument is similar to the description in the onCallRedirected() callback, except that the PJSIP_REDIRECT_PENDING is not accepted here.

◆ dialDtmf()

void pj::Call::dialDtmf ( const string &  digits)
throw (Error
)

Send DTMF digits to remote using RFC 2833 payload formats.

Parameters
digitsDTMF string digits to be sent.

◆ sendDtmf()

void pj::Call::sendDtmf ( const CallSendDtmfParam param)
throw (Error
)

Send DTMF digits to remote.

Parameters
paramThe send DTMF parameter.

◆ sendInstantMessage()

void pj::Call::sendInstantMessage ( const SendInstantMessageParam prm)
throw (Error
)

Send instant messaging inside INVITE session.

Parameters
prm.contentTypeMIME type.
prm.contentThe message content.
prm.txOptionOptional list of headers etc to be included in outgoing request. The body descriptor in the txOption is ignored.
prm.userDataOptional user data, which will be given back when the IM callback is called.

◆ sendTypingIndication()

void pj::Call::sendTypingIndication ( const SendTypingIndicationParam prm)
throw (Error
)

Send IM typing indication inside INVITE session.

Parameters
prm.isTypingTrue to indicate to remote that local person is currently typing an IM.
prm.txOptionOptional list of headers etc to be included in outgoing request.

◆ sendRequest()

void pj::Call::sendRequest ( const CallSendRequestParam prm)
throw (Error
)

Send arbitrary request with the call. This is useful for example to send INFO request. Note that application should not use this function to send requests which would change the invite session's state, such as re-INVITE, UPDATE, PRACK, and BYE.

Parameters
prm.methodSIP method of the request.
prm.txOptionOptional message body and/or list of headers to be included in outgoing request.

◆ dump()

string pj::Call::dump ( bool  with_media,
const string  indent 
)
throw (Error
)

Dump call and media statistics to string.

Parameters
with_mediaTrue to include media information too.
indentSpaces for left indentation.
Returns
Call dump and media statistics string.

◆ vidGetStreamIdx()

int pj::Call::vidGetStreamIdx ( ) const

Get the media stream index of the default video stream in the call. Typically this will just retrieve the stream index of the first activated video stream in the call. If none is active, it will return the first inactive video stream.

Returns
The media stream index or -1 if no video stream is present in the call.

◆ vidStreamIsRunning()

bool pj::Call::vidStreamIsRunning ( int  med_idx,
pjmedia_dir  dir 
) const

Determine if video stream for the specified call is currently running (i.e. has been created, started, and not being paused) for the specified direction.

Parameters
med_idxMedia stream index, or -1 to specify default video media.
dirThe direction to be checked.
Returns
True if stream is currently running for the specified direction.

◆ vidSetStream()

void pj::Call::vidSetStream ( pjsua_call_vid_strm_op  op,
const CallVidSetStreamParam param 
)
throw (Error
)

Add, remove, modify, and/or manipulate video media stream for the specified call. This may trigger a re-INVITE or UPDATE to be sent for the call.

Parameters
opThe video stream operation to be performed, possible values are pjsua_call_vid_strm_op.
paramThe parameters for the video stream operation (see CallVidSetStreamParam).

◆ audStreamModifyCodecParam()

void pj::Call::audStreamModifyCodecParam ( int  med_idx,
const CodecParam param 
)
throw (Error
)

Modify the audio stream's codec parameter after the codec is opened. Note that not all codec parameters can be modified during run-time. Currently, only Opus codec supports changing key codec parameters such as bitrate and bandwidth, while other codecs may only be able to modify minor settings such as VAD or PLC.

Parameters
med_idxMedia stream index, or -1 to specify default audio media.
paramThe new codec parameter.
Returns
PJ_SUCCESS on success.

◆ getStreamInfo()

StreamInfo pj::Call::getStreamInfo ( unsigned  med_idx) const
throw (Error
)

Get media stream info for the specified media index.

Parameters
med_idxMedia stream index.
Returns
The stream info.

◆ getStreamStat()

StreamStat pj::Call::getStreamStat ( unsigned  med_idx) const
throw (Error
)

Get media stream statistic for the specified media index.

Parameters
med_idxMedia stream index.
Returns
The stream statistic.

◆ getMedTransportInfo()

MediaTransportInfo pj::Call::getMedTransportInfo ( unsigned  med_idx) const
throw (Error
)

Get media transport info for the specified media index.

Parameters
med_idxMedia stream index.
Returns
The transport info.

◆ processMediaUpdate()

void pj::Call::processMediaUpdate ( OnCallMediaStateParam prm)

Internal function (callled by Endpoint( to process update to call medias when call media state changes.

◆ processStateChange()

void pj::Call::processStateChange ( OnCallStateParam prm)

Internal function (called by Endpoint) to process call state change.

◆ onCallState()

virtual void pj::Call::onCallState ( OnCallStateParam prm)
inlinevirtual

Notify application when call state has changed. Application may then query the call info to get the detail call states by calling getInfo() function.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallTsxState()

virtual void pj::Call::onCallTsxState ( OnCallTsxStateParam prm)
inlinevirtual

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.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallMediaState()

virtual void pj::Call::onCallMediaState ( OnCallMediaStateParam prm)
inlinevirtual

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.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallSdpCreated()

virtual void pj::Call::onCallSdpCreated ( OnCallSdpCreatedParam prm)
inlinevirtual

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.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onStreamPreCreate()

virtual void pj::Call::onStreamPreCreate ( OnStreamPreCreateParam prm)
inlinevirtual

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: jbInit, jbMinPre, jbMaxPre, jbMax, useKa, rtcpSdesByeDisabled, jbDiscardAlgo (audio), vidCodecParam.encFmt (video).

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onStreamCreated()

virtual void pj::Call::onStreamCreated ( OnStreamCreatedParam prm)
inlinevirtual

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.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onStreamDestroyed()

virtual void pj::Call::onStreamDestroyed ( OnStreamDestroyedParam prm)
inlinevirtual

Notify application when audio media session has been unregistered from the conference bridge and about to be destroyed.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onDtmfDigit()

virtual void pj::Call::onDtmfDigit ( OnDtmfDigitParam prm)
inlinevirtual

Notify application upon incoming DTMF digits.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onDtmfEvent()

virtual void pj::Call::onDtmfEvent ( OnDtmfEventParam prm)
inlinevirtual

Notify application upon incoming DTMF events.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallTransferRequest()

virtual void pj::Call::onCallTransferRequest ( OnCallTransferRequestParam prm)
inlinevirtual

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 implemented, the default behavior is to accept the transfer.

If application decides to accept the transfer request, it must also instantiate the new Call object for the transfer operation and return this new Call object to prm.newCall. For the new Call instance, the account should use the same account as this call and the call ID must be set to PJSUA_INVALID_ID.

If application does not specify new Call object, library will reuse the existing Call object for initiating the new call (to the transfer destination). In this case, any events from both calls (transferred and transferring) will be delivered to the same Call object, where the call ID will be switched back and forth between callbacks. Application must be careful to not destroy the Call object when receiving disconnection event of the transferred call after the transfer process is completed.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallTransferStatus()

virtual void pj::Call::onCallTransferStatus ( OnCallTransferStatusParam prm)
inlinevirtual

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.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallReplaceRequest()

virtual void pj::Call::onCallReplaceRequest ( OnCallReplaceRequestParam prm)
inlinevirtual

Notify application about incoming INVITE with Replaces header. Application may reject the request by setting non-2xx code.

In this callback, application should create a new Call instance and return the Call object via prm.newCall. In creating the new Call instance, the account should use the same account as this call and the call ID must be set to PJSUA_INVALID_ID.

If application does not specify new Call object, library will reuse the existing Call object for callbacks. In this case, any events from both calls (replaced and new) will be delivered to the same Call object, where the call ID will be switched back and forth between callbacks. Application must be careful to not destroy the Call object when receiving disconnection event of the replaced call after the transfer process is completed.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallReplaced()

virtual void pj::Call::onCallReplaced ( OnCallReplacedParam prm)
inlinevirtual

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.

After this callback is called, normally PJSUA-API will disconnect this call and establish a new call.

If not yet done in onCallReplaceRequest(), application can create the new Call instance and return the Call object via prm.newCall. In creating the new Call instance, the account should use the same account as this call and the call ID must be set to prm.newCallId.

If the new Call instance has been setup in onCallReplaceRequest(), the prm.newCall should contain the new Call instance and application MUST not change it.

If application does not specify new Call object, library will reuse the existing Call object for callbacks. In this case, any events from both calls (replaced and new) will be delivered to the same Call object, where the call ID will be switched back and forth between callbacks. Application must be careful to not destroy the Call object when receiving disconnection event of the replaced call after the transfer process is completed.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallRxOffer()

virtual void pj::Call::onCallRxOffer ( OnCallRxOfferParam prm)
inlinevirtual

Notify application when call has received new offer from remote (i.e. re-INVITE/UPDATE with SDP is received). 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 implemented, the default behavior is to accept the offer using current call setting.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallRxReinvite()

virtual void pj::Call::onCallRxReinvite ( OnCallRxReinviteParam prm)
inlinevirtual

Notify application when call has received a re-INVITE 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 pj::Call::answer() and setting the SDP answer. Otherwise, by default the re-INVITE will be answered automatically after the callback returns.

Currently, this callback is only called for re-INVITE with SDP, but app should be prepared to handle the case of re-INVITE without SDP.

Remarks: If manually answering at a later timing, application may need to monitor onCallTsxState() callback to check whether the re-INVITE is already answered automatically with 487 due to being cancelled.

Note: onCallRxOffer() will still be called after this callback, but only if prm.async is false and prm.code is 200.

References PJ_UNUSED_ARG.

◆ onCallTxOffer()

virtual void pj::Call::onCallTxOffer ( OnCallTxOfferParam prm)
inlinevirtual

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.

When this callback is not implemented, the default behavior is to send SDP offer using current active media session (with all enabled codecs on each media type).

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onInstantMessage()

virtual void pj::Call::onInstantMessage ( OnInstantMessageParam prm)
inlinevirtual

Notify application on incoming MESSAGE request.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onInstantMessageStatus()

virtual void pj::Call::onInstantMessageStatus ( OnInstantMessageStatusParam prm)
inlinevirtual

Notify application about the delivery status of outgoing MESSAGE request.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onTypingIndication()

virtual void pj::Call::onTypingIndication ( OnTypingIndicationParam prm)
inlinevirtual

Notify application about typing indication.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallRedirected()

virtual pjsip_redirect_op pj::Call::onCallRedirected ( OnCallRedirectedParam prm)
inlinevirtual

This callback is called when the call is about to resend the INVITE request to the specified target, following the previously received redirection response.

Application may accept the redirection to the specified target, reject this target only and make the session continue to try the next target in the list if such target exists, stop the whole redirection process altogether and cause the session to be disconnected, or defer the decision to ask for user confirmation.

This callback is optional, the default behavior is to NOT follow the redirection response.

Parameters
prmCallback parameter.
Returns
Action to be performed for the target. Set this parameter to one of the value below:
  • PJSIP_REDIRECT_ACCEPT: immediately accept the redirection. When set, the call will immediately resend INVITE request to the target.
  • PJSIP_REDIRECT_ACCEPT_REPLACE: immediately accept the redirection and replace the To header with the current target. When set, the call will immediately resend INVITE request to the target.
  • PJSIP_REDIRECT_REJECT: immediately reject this target. The call will continue retrying with next target if present, or disconnect the call if there is no more target to try.
  • PJSIP_REDIRECT_STOP: stop the whole redirection process and immediately disconnect the call. The onCallState() callback will be called with PJSIP_INV_STATE_DISCONNECTED state immediately after this callback returns.
  • PJSIP_REDIRECT_PENDING: set to this value if no decision can be made immediately (for example to request confirmation from user). Application then MUST call processRedirect() to either accept or reject the redirection upon getting user decision.

References PJ_UNUSED_ARG, and PJSIP_REDIRECT_STOP.

◆ onCallMediaTransportState()

virtual void pj::Call::onCallMediaTransportState ( OnCallMediaTransportStateParam prm)
inlinevirtual

This callback is called when media transport state is changed.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCallMediaEvent()

virtual void pj::Call::onCallMediaEvent ( OnCallMediaEventParam prm)
inlinevirtual

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.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCreateMediaTransport()

virtual void pj::Call::onCreateMediaTransport ( OnCreateMediaTransportParam prm)
inlinevirtual

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.

This callback is called when a new call is created. The library has created a media transport for the call, and it is provided as the mediaTp argument of this callback. The callback may change it with the instance of media transport to be used by the call.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.

◆ onCreateMediaTransportSrtp()

virtual void pj::Call::onCreateMediaTransportSrtp ( OnCreateMediaTransportSrtpParam prm)
inlinevirtual

Warning: deprecated and may be removed in future release. Application can set SRTP crypto settings (including keys) and keying methods via AccountConfig.mediaConfig.srtpOpt. See also ticket #2100.

This callback is called when SRTP media transport is created. Application can modify the SRTP setting srtpOpt to specify the cryptos and keys which are going to be used. Note that application should not modify the field pjmedia_srtp_setting.close_member_tp and can only modify the field pjmedia_srtp_setting.use for initial INVITE.

Parameters
prmCallback parameter.

References PJ_UNUSED_ARG.


The documentation for this class was generated from the following file:

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.