MyChat Server event: OnMediaCallStarted, media call start
The event is generated when the call starts and a user approves an incoming call.
Event template
procedure OnMediaCallStarted(iUINFrom, iUINTo, iCallType, iMID: integer; sUINFromClientType, sUINToClientType: 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 |
|
iMID |
integer |
call unique number generated by the server (Media ID); |
sUINFromClientType |
string |
application type that performs the call; |
sUINToClientType |
string |
application type that receives the call. |
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 OnMediaCallStarted(iUINFrom, iUINTo, iCallType, iMID: integer; sUINFromClientType, sUINToClientType: string);
var
s: string;
begin
s := IntToStr(iUINFrom) + ', ' + IntToStr(iUINTo) + ', ' + IntToStr(iCallType) + ', ' + IntToStr(iMID) + ', ' +
sUINFromCLientType + ', ' + sUINToClientType;
mSendPrivateMessage(0, 6, 'Call started: ' + CRLF + s, 1);
end;
begin
end.