The event for the end of a voice, video, screen sharing call.

 

Event template


procedure OnMediaCallFinished(iUINFrom, iUINTo, iCallType, iMID, iDuration, iCallState: integer; sUINFromClientType, sUINToClientType, sError: string);
begin
  // your own code
end;
begin
end.


You can put your code instead of the comment.

 

Description of parameters

Parameter

Type

Value

iUINFrom

integer

caller ID;

iUINTo

integer

call recipient ID;

iCallType

integer

call type;

iMID

integer

call unique number generated by the server (Media ID);

iDuration

integer

call duration in seconds, if a call was successful;

iCallState

integer

call final status (successful/failed/error, etc.);

sUINFromClientType

string

application type that performs the call;

sUINToClientType

string

application type that receives the call.

sError

string

error text if the call was unsuccessful.

 

Example

The script detects all the calls and sends debugging information to a user with UIN=6 on behalf of the bot (UIN=0) as a text message.


procedure OnMediaCallFinished(iUINFrom, iUINTo, iCallType, iMID, iDuration, iCallState: integer; sUINFromClientType, sUINToClientType, sError: string);
var
  s: string;
begin
  s := 'iUINFrom: ' + IntToStr(iUINFrom) + ', iUINTo: ' + IntToStr(iUINTo) + ', iCallType: ' + IntToStr(iCallType) + ', iMID: ' + IntToStr(iMID) + ', '
       'iDuration: ' + IntToStr(iDuration) + ', iCallState: ' + IntToStr(iCallState) + ', '
       'sUINFromClientType: ' + sUINFromClientType + ', sUINToClientType: ' + sUINToClientType + ', sError: ' + sError;
  
  mSendPrivateMessage(0, 6, 'Call finished: ' + CRLF + s, 1);
end;
begin
end.


See also

CRLF

IntToStr
mSendPrivateMessage