Updated documentation about external modules.
git-svn-id: http://yate.null.ro/svn/yate/trunk@54 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
1003d03cec
commit
4697c9bb70
|
@ -22,9 +22,7 @@ File descriptors 3 and 4 are open only for audio capable applications.<br />
|
||||||
|
|
||||||
<h2>Format of commands and notifications</h2>
|
<h2>Format of commands and notifications</h2>
|
||||||
|
|
||||||
In the following description the _ (underscore) character is used to denote
|
<p>
|
||||||
the TAB character (\t, ^I, decimal 9) used as element separator.<br />
|
|
||||||
|
|
||||||
Words enclosed in <angle brackets> must be replaced with the proper value.<br />
|
Words enclosed in <angle brackets> must be replaced with the proper value.<br />
|
||||||
|
|
||||||
Elements in [square brackets] are optional. An ellipsis ... denotes optional
|
Elements in [square brackets] are optional. An ellipsis ... denotes optional
|
||||||
|
@ -33,87 +31,170 @@ repetition of the last element.<br />
|
||||||
Every command is sent on its own newline (\n, ^J, decimal 10) delimited line.<br />
|
Every command is sent on its own newline (\n, ^J, decimal 10) delimited line.<br />
|
||||||
|
|
||||||
Any value that contains special characters (ASCII code lower than 32) MUST have
|
Any value that contains special characters (ASCII code lower than 32) MUST have
|
||||||
them converted to %<hexcode> where <hexcode> is the 2 character hexadecimal
|
them converted to %<upcode> where <upcode> is the character with a
|
||||||
representation of that ASCII code. The % character itself MUST be converted to
|
numeric value equal with 32 + original ASCII code. The % character itself MUST
|
||||||
its %25 representation. Characters with codes higher than 32 (except %) SHOULD
|
be converted to a special %% representation. Characters with codes higher than 32
|
||||||
not be escaped but may be so. An %-escaped code may be received instead of an
|
(except %) SHOULD not be escaped but may be so. A %-escaped code may be received
|
||||||
unescaped character anywhere except in the initial keyword or the delimiting
|
instead of an unescaped character anywhere except in the initial keyword or the
|
||||||
TAB characters. Anywhere in the line except the initial keyword a % character
|
delimiting colon (:) characters. Anywhere in the line except the initial keyword
|
||||||
not followed by 2 hexadecimal digits is an error.<br />
|
a % character not followed by a character with a numeric value higher than 32
|
||||||
|
(20H, 0x20, ' ') is an error.<br />
|
||||||
|
</p>
|
||||||
|
|
||||||
<p><b>Keyword: %%=error</b><br />
|
<p><b>Special Keyword: Error in</b><br />
|
||||||
%%=error_<original><br />
|
Error in:<original><br />
|
||||||
|
<b>Direction: Engine to application</b><br />
|
||||||
The engine sends this notification as answer to a syntactically incorrect line
|
The engine sends this notification as answer to a syntactically incorrect line
|
||||||
it received from the application.<br />
|
it received from the application.<br />
|
||||||
<original> - the original line exactly as received (not escaped or something)<br />
|
<original> - the original line exactly as received (not escaped or something)<br />
|
||||||
</p>
|
The external module SHOULD NOT send anything back to Yate in response to such a
|
||||||
|
notification as it can result in an infinite loop.<br />
|
||||||
<p><b>Keyword: %%=init</b><br />
|
|
||||||
%%=init<br />
|
|
||||||
This command is sent to the other party requesting it to (re)initialize.<br />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><b>Keyword: %%=halt</b><br />
|
|
||||||
%%=halt[_<exitcode>]<br />
|
|
||||||
Command from application to the engine asking it to terminate. An optional
|
|
||||||
exit code may be provided.<br />
|
|
||||||
<exitcode> - positive numeric engine exit code<br />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><b>Keyword: %%=output</b><br />
|
|
||||||
%%=output_<message><br />
|
|
||||||
Asks the engine to display a message in its console output.<br />
|
|
||||||
<message> - message line to display as-is<br />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><b>Keyword: %%=debug</b><br />
|
|
||||||
%%=debug_[<facility>]_<level>_<message><br />
|
|
||||||
Asks the engine to emit a debugging message to the console output.<br />
|
|
||||||
<facility> - optional facility text to display<br />
|
|
||||||
<level> - numeric debug level (0-9) at which to output<br />
|
|
||||||
<message> - debug message to display<br />
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><b>Keyword: %%>message</b><br />
|
<p><b>Keyword: %%>message</b><br />
|
||||||
%%>message_<id>_<name>_<retvalue>[_<key>=<value>...]<br />
|
%%>message:<id>:<time>:<name>:<retvalue>[:<key>=<value>...]<br />
|
||||||
This is sent by a party (engine or application) to ask the other to run a
|
<b>Direction: Engine to application</b><br />
|
||||||
message trough its handlers. The local message must be held until an answer is
|
This line is sent by the engine to the application) to ask it to process a message.
|
||||||
received.<br />
|
The Yate thread that dispatches the message will block until an answer is
|
||||||
<id> - obscure unique message ID string generated by the sender<br />
|
received (see below).<br />
|
||||||
|
<id> - obscure unique message ID string generated by Yate<br />
|
||||||
|
<time> - time (in seconds) the message was initially created<br />
|
||||||
<name> - name of the message<br />
|
<name> - name of the message<br />
|
||||||
<retvalue> - default textual return value of the message<br />
|
<retvalue> - default textual return value of the message<br />
|
||||||
<key>=<value> - enumeration of the key-value pairs of the message<br />
|
<key>=<value> - enumeration of the key-value pairs of the message<br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><b>Keyword: %%<message</b><br />
|
<p><b>Keyword: %%<message</b><br />
|
||||||
%%<message_<id>_<processed>_[<name>]_<retvalue>[_<key>=<value>...]<br />
|
%%<message:<id>:<processed>:[<name>]:<retvalue>[:<key>=<value>...]<br />
|
||||||
One of this answer is required for every received message (%%>message). When a
|
<b>Direction: Application to engine</b><br />
|
||||||
party gets a line in this format it should paste the provided values back into
|
One such answer is required for every received message (%%>message). When
|
||||||
the message and let it continue.<br />
|
the engine gets a line in this format it modifies the provided values back into
|
||||||
|
the message and let it continue or stop dispatching.<br />
|
||||||
<id> - same message ID string received trough %%>message<br />
|
<id> - same message ID string received trough %%>message<br />
|
||||||
<processed> - boolean ("true" or "false") indication if the message has been
|
<processed> - boolean ("true" or "false") indication
|
||||||
processed or it should be passed to the next handler<br />
|
if the message has been processed or it should be passed to the next handler<br />
|
||||||
<name> - new name of the message, if empty keep unchanged<br />
|
<name> - new name of the message, if empty keep unchanged<br />
|
||||||
<retvalue> - new textual return value of the message<br />
|
<retvalue> - new textual return value of the message<br />
|
||||||
<key>=<value> - new key-value pairs to set in the message; delete the key if
|
<key>=<value> - new key-value pairs to set in the message; to delete
|
||||||
the value is an empty string<br />
|
the key-value pair provide just a key name with no equal sign or value<br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><b>Keyword: %%>message</b><br />
|
||||||
|
%%>message:<id>:<time>:<name>:<retvalue>[:<key>=<value>...]<br />
|
||||||
|
<b>Direction: Application to engine</b><br />
|
||||||
|
This line is sent by the application to the engine to ask it to process a message.
|
||||||
|
The answer to such a message is delivered asynchronously (see below).<br />
|
||||||
|
<id> - obscure unique message ID string generated by the application<br />
|
||||||
|
<time> - time (in seconds) the message was initially created<br />
|
||||||
|
<name> - name of the message<br />
|
||||||
|
<retvalue> - default textual return value of the message<br />
|
||||||
|
<key>=<value> - enumeration of the key-value pairs of the message<br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><b>Keyword: %%<message</b><br />
|
||||||
|
%%<message:<id>:<processed>:[<name>]:<retvalue>[:<key>=<value>...]<br />
|
||||||
|
<b>Direction: Engine to application</b><br />
|
||||||
|
One such answer is required for every message (%%>message) the application
|
||||||
|
sent to the engine. It contains the message's return values and parameters.<br />
|
||||||
|
<id> - same message ID string received trough %%>message<br />
|
||||||
|
<processed> - boolean ("true" or "false") indication
|
||||||
|
if the message has been declared processed by one of the handlers<br />
|
||||||
|
<name> - name of the message, possibly changed<br />
|
||||||
|
<retvalue> - textual return value of the message<br />
|
||||||
|
<key>=<value> - key-value pairs of parameters to the message.<br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><b>Keyword: %%>install</b><br />
|
<p><b>Keyword: %%>install</b><br />
|
||||||
%%>install_<name>[_<priority>]<br />
|
%%>install:[<priority>]:<name><br />
|
||||||
|
<b>Direction: Application to engine</b><br />
|
||||||
Always from the application to the engine, requests the installing of a message
|
Always from the application to the engine, requests the installing of a message
|
||||||
handler<br />
|
handler for the application that requested it<br />
|
||||||
|
The answer to the install request is delivered asynchronously (see below).<br />
|
||||||
|
<priority> - priority in chain, use default (100) if missing<br />
|
||||||
<name> - name of the messages for that a handler should be installed<br />
|
<name> - name of the messages for that a handler should be installed<br />
|
||||||
<priority> - priority, use default if missing<br />
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><b>Keyword: %%<install</b><br />
|
<p><b>Keyword: %%<install</b><br />
|
||||||
%%<install_<name>_<priority><br />
|
%%<install:<priority>:<name>:<success><br />
|
||||||
|
<b>Direction: Engine to application</b><br />
|
||||||
Confirmation from engine to the application that the handler has been installed
|
Confirmation from engine to the application that the handler has been installed
|
||||||
properly or not.<br />
|
properly or not.<br />
|
||||||
|
<priority> - priority of the installed handler<br />
|
||||||
<name> - name of the messages asked to handle<br />
|
<name> - name of the messages asked to handle<br />
|
||||||
<priority> - priority of the installed handler, -1 if it failed<br />
|
<success> - boolean ("true" or "false") success of operation<br />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p><b>Keyword: %%>uninstall</b><br />
|
||||||
|
%%>install:<name><br />
|
||||||
|
<b>Direction: Application to engine</b><br />
|
||||||
|
Always from the application to the engine, requests uninstalling a previously
|
||||||
|
installed message handler<br />
|
||||||
|
The answer to the uninstall request is delivered asynchronously (see below).<br />
|
||||||
|
<name> - name of the message handler thst should be uninstalled<br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p><b>Keyword: %%<uninstall</b><br />
|
||||||
|
%%<install:<priority>:<name>:<success><br />
|
||||||
|
<b>Direction: Engine to application</b><br />
|
||||||
|
Confirmation from engine to the application that the handler has been uninstalled
|
||||||
|
properly or not.<br />
|
||||||
|
<priority> - priority of the previously installed handler<br />
|
||||||
|
<name> - name of the message handler asked to uninstall<br />
|
||||||
|
<success> - boolean ("true" or "false") success of operation<br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Example</h2>
|
||||||
|
<p>
|
||||||
|
In the example below the lines sent from application to engine are prefixed with
|
||||||
|
A: while lines sent from engine to application are prefixed with E:<br />
|
||||||
|
Comments are indented<br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
|
||||||
|
Application installs a handler for a "test" handler with priority 50
|
||||||
|
A: %%>install:50:test
|
||||||
|
|
||||||
|
Engine installs the handler and acknowledges it
|
||||||
|
E: %%<install:50:test:true
|
||||||
|
|
||||||
|
Application installs a handler for the "engine.timer" handler with default priority
|
||||||
|
A: %%>install::engine.timer
|
||||||
|
|
||||||
|
Engine installs the handler and acknowledges it
|
||||||
|
E: %%<install:100:engine.timer:true
|
||||||
|
|
||||||
|
Application emits a private "app.job" message; notice how the '%' and ':' characters were escaped
|
||||||
|
A: %%>message:myapp55251:1095112794::job=cleanup:done=75%%:path=/bin%Z/usr/bin
|
||||||
|
|
||||||
|
Engine just dispatched an "engine.timer" message
|
||||||
|
E: %%>message:234479208:1095112795:engine.timer::time=1095112795
|
||||||
|
|
||||||
|
Engine gets back the answer to the "app.job" message
|
||||||
|
E: %%<message:myapp55251:true:Restart required:path=/bin%Z/usr/bin%Z/usr/local/bin
|
||||||
|
|
||||||
|
Application ignores the timer message
|
||||||
|
A: %%<message:234479208:false:engine.timer::time=1095112795
|
||||||
|
|
||||||
|
Application uninstalls the "test" handler
|
||||||
|
A: %%>uninstall:test
|
||||||
|
|
||||||
|
Engine removes the handler and acknowledges it
|
||||||
|
E: %%<uninstall:50:test:true
|
||||||
|
|
||||||
|
Engine just dispatched another "engine.timer" message
|
||||||
|
E: %%>message:234479288:1095112796:engine.timer::time=1095112796
|
||||||
|
|
||||||
|
Application modifies the timer message but lets it flow further
|
||||||
|
A: %%<message:234479288:false:engine.timer::time=1095112796:extra=yes
|
||||||
|
|
||||||
|
Engine just dispatched another "engine.timer" message
|
||||||
|
E: %%>message:234479244:1095112797:engine.timer::time=1095112797
|
||||||
|
|
||||||
|
Application suddenly exits without acknowledging previous message.
|
||||||
|
The engine releases the message 234479244 (as if "false" was returned) and
|
||||||
|
uninstalls the remaining "engine.timer" handler
|
||||||
|
</pre>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -18,6 +18,6 @@ data.</p>
|
||||||
<a href="api/hier.html">Class hierarcy</a><br />
|
<a href="api/hier.html">Class hierarcy</a><br />
|
||||||
<a href="messages.html">Messages</a><br />
|
<a href="messages.html">Messages</a><br />
|
||||||
<a href="dataflow.html">Data flows</a><br />
|
<a href="dataflow.html">Data flows</a><br />
|
||||||
<!-- <a href="extmodule.html">External module</a><br /> -->
|
<a href="extmodule.html">External module</a><br />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue