Skip to main content

Push_auto_add

Push_Auto_Add

This call is similar in workings to the "" call (see that call for details), with the following changes:

Pushes are only started for currently active (active meaning they have at least one sessions attached to them of any type) streams matching the request, and only if no matching push is already active. As such, duplicate pushes will not be created by this call.

Any matching streams that become active in the future, will upon activation also start a push as requested here, until the automatic push is removed again (using the "push_auto_remove" call, see below).

If a push stops while the stream is still active, it will only be restarted if the current "" behaviour dictates such (by default, it will not be).

The behaviour is slightly different if a 'scheduletime' and/or 'completetime' are given. The automatic push will activate automatically at the given 'scheduletime'. If no 'completetime' is given, the automatic push is removed as soon as it activates (effectively turning the automatic push into a regular push on 'scheduletime'). If a 'completetime' is given, it will automatically restart between 'scheduletime' and 'completetime' as-needed, and actively kill the push process at 'completetime' as-needed. After 'completetime' has passed, the automatic push is automatically removed.

Should you want to alter or add the 'scheduletime' or 'completetime' of an automatic push after it has been created, this can be done by another 'push_auto_add' call where identical 'stream' and 'target' parameters are given. The push will then update the existing entry and immediately start behaving according to the new values. This method can also be used to remove the parameters after creation. In either case it does not matter if the same form of request is used (array or object form), they can be used interchangeably.

It is requested as follows:

//Either...
{
"push_auto_add":{
"stream": "STREAMNAME",
"target": "URI",
"scheduletime": 1234567, //Unix timestamp when the push process should be started, optional
"completetime": 1234567 //Unix timestamp when the push process should be terminated, optional
}
}
//Or...
{
//Same parameters as above, in order
//the scheduletime and completetime are both optional
"push_auto_add":["STREAMNAME", "URI", 1234567, 1234567]
}

There is no response to this call.