Home --> Documentations --> PJSIP Reference
#include <call.hpp>
|
| 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 |
|
Media * | getMedia (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 ¶m) 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 ¶m) throw (Error) |
|
void | audStreamModifyCodecParam (int med_idx, const CodecParam ¶m) 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) |
|
◆ Call()
pj::Call::Call |
( |
Account & |
acc, |
|
|
int |
call_id = PJSUA_INVALID_ID |
|
) |
| |
◆ ~Call()
virtual pj::Call::~Call |
( |
| ) |
|
|
virtual |
◆ getInfo()
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_id | The 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
-
- Returns
- The media or NULL if invalid or inactive.
◆ getAudioMedia()
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_idx | Media 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_idx | Media 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_idx | Media index, or -1 to specify any first video media with decoding direction registered in the conference bridge. |
- Returns
- The video media.
◆ remoteHasCap()
Check if remote peer support the specified capability.
- Parameters
-
htype | The header type (pjsip_hdr_e) to be checked, which value may be:
- PJSIP_H_ACCEPT
- PJSIP_H_ALLOW
- PJSIP_H_SUPPORTED
|
hname | If htype specifies PJSIP_H_OTHER, then the header name must be supplied in this argument. Otherwise the value must be set to empty string (""). |
token | The 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_data | Arbitrary 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()
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_uri | URI to be put in the To header (normally is the same as the target URI). |
prm.opt | Optional call setting. |
prm.txOption | Optional headers etc to be added to outgoing INVITE request. |
◆ answer()
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.opt | Optional call setting. |
prm.statusCode | Status code, (100-699). |
prm.reason | Optional reason phrase. If empty, default text will be used. |
prm.txOption | Optional 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()
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.statusCode | Optional status code to be sent when we're rejecting incoming call. If the value is zero, "603/Decline" will be sent. |
prm.reason | Optional reason phrase to be sent when we're rejecting incoming call. If empty, default text will be used. |
prm.txOption | Optional list of headers etc to be added to outgoing request/response message. |
◆ setHold()
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.options | Bitmask of pjsua_call_flag constants. Currently, only the flag PJSUA_CALL_UPDATE_CONTACT can be used. |
prm.txOption | Optional message components to be sent with the request. |
◆ reinvite()
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.opt | Optional call setting, if empty, the current call setting will remain unchanged. |
prm.opt.flag | Bitmask of pjsua_call_flag constants. Specifying PJSUA_CALL_UNHOLD here will release call hold. |
prm.txOption | Optional message components to be sent with the request. |
◆ update()
Send UPDATE request.
- Parameters
-
prm.opt | Optional call setting, if empty, the current call setting will remain unchanged. |
prm.txOption | Optional 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
-
dest | URI of new target to be contacted. The URI may be in name address or addr-spec format. |
prm.txOption | Optional message components to be sent with the request. |
◆ xferReplaces()
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_call | The call to be replaced. |
prm.options | Application 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.txOption | Optional message components to be sent with the request. |
◆ processRedirect()
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
-
cmd | Redirection 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
-
digits | DTMF string digits to be sent. |
◆ sendDtmf()
Send DTMF digits to remote.
- Parameters
-
param | The send DTMF parameter. |
◆ sendInstantMessage()
Send instant messaging inside INVITE session.
- Parameters
-
prm.contentType | MIME type. |
prm.content | The message content. |
prm.txOption | Optional list of headers etc to be included in outgoing request. The body descriptor in the txOption is ignored. |
prm.userData | Optional user data, which will be given back when the IM callback is called. |
◆ sendTypingIndication()
Send IM typing indication inside INVITE session.
- Parameters
-
prm.isTyping | True to indicate to remote that local person is currently typing an IM. |
prm.txOption | Optional list of headers etc to be included in outgoing request. |
◆ sendRequest()
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.method | SIP method of the request. |
prm.txOption | Optional 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_media | True to include media information too. |
indent | Spaces 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_idx | Media stream index, or -1 to specify default video media. |
dir | The direction to be checked. |
- Returns
- True if stream is currently running for the specified direction.
◆ vidSetStream()
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
-
op | The video stream operation to be performed, possible values are pjsua_call_vid_strm_op. |
param | The 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_idx | Media stream index, or -1 to specify default audio media. |
param | The 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_idx | Media 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_idx | Media stream index. |
- Returns
- The stream statistic.
◆ getMedTransportInfo()
Get media transport info for the specified media index.
- Parameters
-
med_idx | Media stream index. |
- Returns
- The transport info.
◆ processMediaUpdate()
Internal function (callled by Endpoint( to process update to call medias when call media state changes.
◆ processStateChange()
Internal function (called by Endpoint) to process call state change.
◆ onCallState()
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
-
References PJ_UNUSED_ARG.
◆ onCallTsxState()
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
-
References PJ_UNUSED_ARG.
◆ onCallMediaState()
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
-
References PJ_UNUSED_ARG.
◆ onCallSdpCreated()
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
-
References PJ_UNUSED_ARG.
◆ onStreamPreCreate()
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
-
References PJ_UNUSED_ARG.
◆ onStreamCreated()
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
-
References PJ_UNUSED_ARG.
◆ onStreamDestroyed()
Notify application when audio media session has been unregistered from the conference bridge and about to be destroyed.
- Parameters
-
References PJ_UNUSED_ARG.
◆ onDtmfDigit()
Notify application upon incoming DTMF digits.
- Parameters
-
References PJ_UNUSED_ARG.
◆ onDtmfEvent()
Notify application upon incoming DTMF events.
- Parameters
-
References PJ_UNUSED_ARG.
◆ onCallTransferRequest()
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
-
References PJ_UNUSED_ARG.
◆ onCallTransferStatus()
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
-
References PJ_UNUSED_ARG.
◆ onCallReplaceRequest()
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
-
References PJ_UNUSED_ARG.
◆ onCallReplaced()
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
-
References PJ_UNUSED_ARG.
◆ onCallRxOffer()
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
-
References PJ_UNUSED_ARG.
◆ onCallRxReinvite()
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()
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
-
References PJ_UNUSED_ARG.
◆ onInstantMessage()
Notify application on incoming MESSAGE request.
- Parameters
-
References PJ_UNUSED_ARG.
◆ onInstantMessageStatus()
Notify application about the delivery status of outgoing MESSAGE request.
- Parameters
-
References PJ_UNUSED_ARG.
◆ onTypingIndication()
Notify application about typing indication.
- Parameters
-
References PJ_UNUSED_ARG.
◆ onCallRedirected()
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
-
- 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()
This callback is called when media transport state is changed.
- Parameters
-
References PJ_UNUSED_ARG.
◆ onCallMediaEvent()
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
-
References PJ_UNUSED_ARG.
◆ onCreateMediaTransport()
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
-
References PJ_UNUSED_ARG.
◆ onCreateMediaTransportSrtp()
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
-
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.
|