External Methods API


    Copyright (C) 1999-2003, WebMaster, Incorporated
    $Id: CRNative.txt,v 1.2 2003/08/26 20:57:34 cvs Exp $

    The Video Module of ConferenceRoom supports an interface to allow custom code to interface with the chat server directly. Please review the Enterprise External Methods if you have any questions about how to interface with ConferenceRoom.

    This capability is experimental in the 2.1 release of ConferenceRoom.

    For managing the stream server, there are two additional native methods:

    1) int AllowStreamConnection(const char *nickbanguserathost, const char *guid, const char *flags_out, char *flags_in, int flags_in_size);

    This function is called when a user requests permission to connect to the stream server. It doesn't not necessarily correspond with an actual connection to the stream server.

    The first parameter is the user's display name. This is in IRC standard format, "nick!user@host". The second parameter is user's GUID. This is a unique identifier used to track a single connection (because the nickname can change).

    The 'flags_out' parameter consists of a list of flags delimited by semi-colons. Each flags consists of a name, an equal sign, and a value. A colon species that the rest of the string consists of a single value.

    For the AllowStreamConnection function, the following flags are defined:

    Note that additional flags may be added at any time and implementations *MUST* ignore unrecognized flags. Also note that flags are never guaranteed to appear.

    Here's an example of a valid flags string:

    CFPSDefault=10;CCFPSLimit=4;ModeFlags=o

    The 'flags_in' parameter is a buffer and the 'flags_in_size' parameter indicates how many bytes it can hold. It will initially contain an empty string. The native method can fill this buffer with string parameters for the server to look at. The following parameters are permitted:

    Note that frame-per-second values that are negative indicate seconds per frame. So an fps value of '10' means ten frames per second, but an fps value of '-10' means one frame every ten seconds. An fps value of '0' mean no limit at all.

    Note that flags are not guaranteed to be honored. If you're finding that flags you need honored are not being honored or you need additional flags defined, contact WebMaster support.

    The return value should be '1' to allow the stream connection and '-1' to disallow it. A return value of '0' indicates that the server should do whatever it would normally do.

    If the return value is '-1' and the first character of the 'flags_in' parameter is a ':', the rest of the buffer will be treated as a message to be sent to the user (presumably explaining why the connection was refused).

    If you plan to use this hook to authorize clients, you should make sure they are normally authorized, usually by authorizing their client class.

    2) int AllowStreamJoin(const char *nickbanguserathost, const char *guid, const char *channel, const char *flags_out, char *flags_in, int flags_in_size);

    If provided, this native method will be called whenever a client requests permission to join a stream. The 'nickbanguserathost' and 'guid' fields are the same as in AllowStreamConnection.

    The 'channel' field will contain the name of the affected channel which is also the name of the stream the user is trying to join.

    The last three fields have the same basic syntax as the AllowStreamConnenction function but with a different set of flags. The outbound flags are:

    Note again that none of these flags are ever guaranteed to appear. If you are not getting flags that you need, please contact WebMaster support.

    And the following 'flags_out' are defined:

    FPS: Actual frame-per-second rate to give the user.
    Feed: Y or N to indicate whether the user may feed the stream.
    Join: Y to indicate the server should force the user into the channel

    The return value should be '1' to allow the stream connection and '-1' to disallow it. A return value of '0' indicates that the server should do what it would normally do.

    If the return value is '-1' and the first character of the 'flags_in' parameter is a ':', the rest of the buffer will be treated as a message to be sent to the user (presumably explaining why the connection was refused).

    Currently, the server will refuse the request without calling this function if the user is not in the channel. This makes the 'Join' output flag meaningless.

    For more information, see the sample native interface code. If you don't have the sample native interface code, contact WebMaster Support. If you have any questions about the ConferenceRoom native code interface, please contact WebMaster Support at support@webmaster.com