Group PJSUA2_CALL

group PJSUA2_CALL

// PJSUA2_Call_Data_Structure

struct CallOpParam
#include <call.hpp>

This structure contains parameters for Call::answer(), Call::hangup(), Call::reinvite(), Call::update(), Call::xfer(), Call::xferReplaces(), Call::setHold().

Public Functions

CallOpParam(bool useDefaultCallSetting = false)

Default constructor initializes with zero/empty values. Setting useDefaultCallSetting to true will initialize opt with default call setting values.

Public Members

CallSetting opt

The call setting.

pjsip_status_code statusCode

Status code.

string reason

Reason phrase.

unsigned options

Options.

SipTxOption txOption

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.

SdpSession sdp

SDP answer. Currently only used for Call::answer().

struct CallSendRequestParam
#include <call.hpp>

This structure contains parameters for Call::sendRequest()

Public Functions

CallSendRequestParam()

Default constructor initializes with zero/empty values.

Public Members

string method

SIP method of the request.

SipTxOption txOption

Message body and/or list of headers etc to be included in outgoing request.

struct CallVidSetStreamParam
#include <call.hpp>

This structure contains parameters for Call::vidSetStream()

Public Functions

CallVidSetStreamParam()

Default constructor

Public Members

int medIdx

Specify the media stream index. This can be set to -1 to denote the default video stream in the call, which is the first active video stream or any first video stream if none is active.

This field is valid for all video stream operations, except PJSUA_CALL_VID_STRM_ADD.

Default: -1 (first active video stream, or any first video stream if none is active)

pjmedia_dir dir

Specify the media stream direction.

This field is valid for the following video stream operations: PJSUA_CALL_VID_STRM_ADD and PJSUA_CALL_VID_STRM_CHANGE_DIR.

Default: PJMEDIA_DIR_ENCODING_DECODING

pjmedia_vid_dev_index capDev

Specify the video capture device ID. This can be set to PJMEDIA_VID_DEFAULT_CAPTURE_DEV to specify the default capture device as configured in the account.

This field is valid for the following video stream operations: PJSUA_CALL_VID_STRM_ADD and PJSUA_CALL_VID_STRM_CHANGE_CAP_DEV.

Default: PJMEDIA_VID_DEFAULT_CAPTURE_DEV.

struct CallSendDtmfParam
#include <call.hpp>

This structure contains parameters for Call::sendDtmf()

Public Functions

CallSendDtmfParam()

Default constructor initialize with default value.

pjsua_call_send_dtmf_param toPj() const

Convert to pjsip.

void fromPj(const pjsua_call_send_dtmf_param &param)

Convert from pjsip.

Public Members

pjsua_dtmf_method method

The method used to send DTMF.

Default: PJSUA_DTMF_METHOD_RFC2833

unsigned duration

The signal duration used for the DTMF.

Default: PJSUA_CALL_SEND_DTMF_DURATION_DEFAULT

string digits

The DTMF digits to be sent.

class Call
#include <call.hpp>

Call.

Public Functions

Call(Account &acc, int call_id = PJSUA_INVALID_ID)

Constructor.

virtual ~Call()

Destructor.

CallInfo getInfo() const

Obtain detail information about this call.

Returns:

Call info.

bool isActive() const

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

Returns:

True if call is active.

int getId() const

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

Returns:

Integer greater than or equal to zero.

bool hasMedia() const

Check if call has an active media session.

Returns:

True if yes.

Media *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.

AudioMedia getAudioMedia(int med_idx) const

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.

VideoMedia getEncodingVideoMedia(int med_idx) const

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.

VideoMedia getDecodingVideoMedia(int med_idx) const

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.

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

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.

void 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.

Token getUserData() const

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

Returns:

The user data.

pj_stun_nat_type 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 PJSIP_SC_OK (200) response to INVITE). As a general case, application should call this function after or in onCallMediaState() callback.

See also

Endpoint::natGetType(), natTypeInSdp

Returns:

The NAT type.

void makeCall(const string &dst_uri, const CallOpParam &prm)

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.

void answer(const CallOpParam &prm)

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, (>= PJSIP_SC_TRYING (100)).

  • 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.

void hangup(const CallOpParam &prm)

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.

void setHold(const CallOpParam &prm)

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.

void reinvite(const CallOpParam &prm)

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.

void update(const CallOpParam &prm)

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.

void xfer(const string &dest, const CallOpParam &prm)

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.

void xferReplaces(const Call &dest_call, const CallOpParam &prm)

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.

void processRedirect(pjsip_redirect_op cmd)

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.

void dialDtmf(const string &digits)

Send DTMF digits to remote using RFC 2833 payload formats.

Parameters:

digits – DTMF string digits to be sent.

void sendDtmf(const CallSendDtmfParam &param)

Send DTMF digits to remote.

Parameters:

param – The send DTMF parameter.

void sendInstantMessage(const SendInstantMessageParam &prm)

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.

void sendTypingIndication(const SendTypingIndicationParam &prm)

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.

void sendRequest(const CallSendRequestParam &prm)

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.

string dump(bool with_media, const string indent)

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.

int 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.

bool 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.

  • dir – The direction to be checked.

Returns:

True if stream is currently running for the specified direction.

void vidSetStream(pjsua_call_vid_strm_op op, const CallVidSetStreamParam &param)

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).

void vidStreamModifyCodecParam(int med_idx, const VidCodecParam &param)

Modify the video stream’s codec parameter after the codec is opened. Note that not all codec backends support modifying parameters during runtime and only certain parameters can be changed.

Currently, only Video Toolbox and OpenH264 backends support runtime adjustment of encoding bitrate (avg_bps and max_bps).

Parameters:
  • med_idx – Video stream index.

  • param – The new codec parameter.

Returns:

PJ_SUCCESS on success.

void audStreamModifyCodecParam(int med_idx, const CodecParam &param)

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.

  • param – The new codec parameter.

Returns:

PJ_SUCCESS on success.

StreamInfo getStreamInfo(unsigned med_idx) const

Get media stream info for the specified media index.

Parameters:

med_idxMedia stream index.

Returns:

The stream info.

StreamStat getStreamStat(unsigned med_idx) const

Get media stream statistic for the specified media index.

Parameters:

med_idxMedia stream index.

Returns:

The stream statistic.

MediaTransportInfo getMedTransportInfo(unsigned med_idx) const

Get media transport info for the specified media index.

Parameters:

med_idxMedia stream index.

Returns:

The transport info.

void processMediaUpdate(OnCallMediaStateParam &prm)

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

void processStateChange(OnCallStateParam &prm)

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

inline virtual void onCallState(OnCallStateParam &prm)

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:

prm – Callback parameter.

inline virtual void onCallTsxState(OnCallTsxStateParam &prm)

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:

prm – Callback parameter.

inline virtual void onCallMediaState(OnCallMediaStateParam &prm)

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:

prm – Callback parameter.

inline virtual void onCallSdpCreated(OnCallSdpCreatedParam &prm)

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:

prm – Callback parameter.

inline virtual void onStreamPreCreate(OnStreamPreCreateParam &prm)

Notify application when an audio media session is about to be created (as opposed to onStreamCreated(), which is 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:

prm – Callback parameter.

inline virtual void onStreamCreated(OnStreamCreatedParam &prm)

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:

prm – Callback parameter.

inline virtual void onStreamDestroyed(OnStreamDestroyedParam &prm)

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

Parameters:

prm – Callback parameter.

inline virtual void onDtmfDigit(OnDtmfDigitParam &prm)

Notify application upon incoming DTMF digits.

Parameters:

prm – Callback parameter.

inline virtual void onDtmfEvent(OnDtmfEventParam &prm)

Notify application upon incoming DTMF events.

Parameters:

prm – Callback parameter.

inline virtual void onCallTransferRequest(OnCallTransferRequestParam &prm)

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:

prm – Callback parameter.

inline virtual void onCallTransferStatus(OnCallTransferStatusParam &prm)

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:

prm – Callback parameter.

inline virtual void onCallReplaceRequest(OnCallReplaceRequestParam &prm)

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:

prm – Callback parameter.

inline virtual void onCallReplaced(OnCallReplacedParam &prm)

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:

prm – Callback parameter.

inline virtual void onCallRxOffer(OnCallRxOfferParam &prm)

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 PJSIP_SC_OK (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:

prm – Callback parameter.

inline virtual void onCallRxReinvite(OnCallRxReinviteParam &prm)

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 prm.isAsync to 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 PJSIP_SC_REQUEST_TERMINATED (487) due to being cancelled.

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

Parameters:

prm – Callback parameter.

inline virtual void onCallTxOffer(OnCallTxOfferParam &prm)

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:

prm – Callback parameter.

inline virtual void onInstantMessage(OnInstantMessageParam &prm)

Notify application on incoming MESSAGE request.

Parameters:

prm – Callback parameter.

inline virtual void onInstantMessageStatus(OnInstantMessageStatusParam &prm)

Notify application about the delivery status of outgoing MESSAGE request.

Parameters:

prm – Callback parameter.

inline virtual void onTypingIndication(OnTypingIndicationParam &prm)

Notify application about typing indication.

Parameters:

prm – Callback parameter.

inline virtual pjsip_redirect_op onCallRedirected(OnCallRedirectedParam &prm)

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:

prm – Callback 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.

inline virtual void onCallMediaTransportState(OnCallMediaTransportStateParam &prm)

This callback is called when media transport state is changed.

Parameters:

prm – Callback parameter.

inline virtual void onCallMediaEvent(OnCallMediaEventParam &prm)

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:

prm – Callback parameter.

inline virtual void onCreateMediaTransport(OnCreateMediaTransportParam &prm)

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:

prm – Callback parameter.

inline virtual void onCreateMediaTransportSrtp(OnCreateMediaTransportSrtpParam &prm)

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:

prm – Callback parameter.

Public Static Functions

static Call *lookup(int call_id)

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.