This event is generated during a media call attempt.

 

Event template


function OnMediaCallRequest(iCID, iUINFrom, iUINTo, iCallType: integer; var sJSONOptions: string): boolean;
begin
  // your own code
  result := true;
end;
begin
end.


You can put your code instead of the comment.

 

Description of parameters

Parameter

Type

Value

iCID

integer

Connection ID of the client, unique session identifier in the online structure of network connections to the server;

iUINFrom

integer

unique identifier of the call performer (number >=0);

iUINTo

integer

unique identifier of the call recipient (number >=0);

iCallType

string

call type;

sJSONOptions

integer

call options, JSON object that can be modified;

 

Return value

By default, this function must return the value "true". However, if you decide to cancel the call, it  returns "false". The call will be interrupted as if a recipient declines it (media_call_reject).

 

Example

The script checks if the call type is video, it enabling the full screen mode for getting the video call request.


function OnMediaCallRequest(iCID, iUINFrom, iUINTo, iCallType: integer; var sJSONOptions: string): boolean;
begin
  if iCallType = 1 then JSONSetBoolean(sJSONOptions, 'FullScreen', true);
  result := true;
end;


See also

OnPrivateMessage

Media calls types