Skip to content

Commit

Permalink
modules: readme files regenerated - mohqueue ... [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kamailio-dev committed Feb 15, 2017
1 parent 89c12e0 commit 0f61923
Showing 1 changed file with 82 additions and 37 deletions.
119 changes: 82 additions & 37 deletions src/modules/mohqueue/README
Expand Up @@ -2,7 +2,7 @@ mohqueue Module

Robert Boisvert

Copyright © 2013-2017 Robert Boisvert, rdbprog@gmail.com
Copyright © 2013 Robert Boisvert, rdbprog@gmail.com
__________________________________________________________________

Table of Contents
Expand All @@ -24,28 +24,34 @@ Robert Boisvert

4. Functions

4.1. mohq_process()
4.2. mohq_send(queue_name)
4.3. mohq_retrieve(queue_name, URI)
4.4. mohq_count(queue_name, pvar)
4.1. mohq_process ()
4.2. mohq_send (queue_name)
4.3. mohq_retrieve (queue_name, URI)
4.4. mohq_count (queue_name, pvar)

5. Database Schema

5.1. MOHQUEUES Table
5.2. MOHQCALLS Table

6. Audio Files
7. RPC Commands

7.1. mohqueue.debug
7.2. mohqueue.drop_call

List of Examples

1.1. Set db_url:
1.2. Set table names:
1.3. Set default directory for audio files:
1.4. Set default directory for audio files:
1.4. Set maximum calls to 200.
1.5. mohq_process usage:
1.6. mohq_send usage:
1.7. mohq_retrieve usage:
1.8. mohq_count usage:
1.9. rpc.debug usage:
1.10. rpc.drop_call usage:

Chapter 1. Admin Guide

Expand All @@ -66,17 +72,21 @@ Chapter 1. Admin Guide

4. Functions

4.1. mohq_process()
4.2. mohq_send(queue_name)
4.3. mohq_retrieve(queue_name, URI)
4.4. mohq_count(queue_name, pvar)
4.1. mohq_process ()
4.2. mohq_send (queue_name)
4.3. mohq_retrieve (queue_name, URI)
4.4. mohq_count (queue_name, pvar)

5. Database Schema

5.1. MOHQUEUES Table
5.2. MOHQCALLS Table

6. Audio Files
7. RPC Commands

7.1. mohqueue.debug
7.2. mohqueue.drop_call

1. Overview

Expand Down Expand Up @@ -132,24 +142,25 @@ Chapter 1. Admin Guide

The URL to connect to the database for the mohqueue tables.

Default value for Kamailio.
Default is the same value used by Kamailio.

Example 1.1. Set db_url:
...
modparam("mohqueue", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
modparam ("mohqueue", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio"
)
...

3.2. db_qtable and db_ctable (str)

db_qtable is the name of the table that defines the queues and
db_ctable is the table that maintains the call status.

"MOHQUEUES" for db_qtable and "MOHQCALLS" for db_ctable.
Default is "MOHQUEUES" for db_qtable and "MOHQCALLS" for db_ctable.

Example 1.2. Set table names:
...
modparam("mohqueue", "db_qtable", "mqueues")
modparam("mohqueue", "db_ctable", "mcalls")
modparam ("mohqueue", "db_qtable", "mqueues")
modparam ("mohqueue", "db_ctable", "mcalls")
...

3.3. mohdir (str)
Expand All @@ -158,11 +169,12 @@ modparam("mohqueue", "db_ctable", "mcalls")
usually relative to this directory although the value can be overridden
by a directory specified in the queues table.

None. If not set by the module it must be defined in the queues table.
Default is None. If not set by the module it must be defined in the
queues table.

Example 1.3. Set default directory for audio files:
...
modparam("mohqueue", "mohdir", "/var/kamailio/MOH")
modparam ("mohqueue", "mohdir", "/var/kamailio/MOH")
...

3.4. moh_maxcalls (integer)
Expand All @@ -172,21 +184,21 @@ modparam("mohqueue", "mohdir", "/var/kamailio/MOH")
5000. NOTE: it may be limited by the processing power of the server or
the number of available rtpproxy ports.

None. If not set by the module it must be defined in the queues table.
Default value is 50.

Example 1.4. Set default directory for audio files:
Example 1.4. Set maximum calls to 200.
...
modparam("mohqueue", "mohdir", "/var/kamailio/MOH")
modparam ("mohqueue", "moh_maxcalls", 200)
...

4. Functions

4.1. mohq_process()
4.2. mohq_send(queue_name)
4.3. mohq_retrieve(queue_name, URI)
4.4. mohq_count(queue_name, pvar)
4.1. mohq_process ()
4.2. mohq_send (queue_name)
4.3. mohq_retrieve (queue_name, URI)
4.4. mohq_count (queue_name, pvar)

4.1. mohq_process()
4.1. mohq_process ()

Checks to see if the current SIP message involves a queue. If it does
it will process the message and return a TRUE value.
Expand Down Expand Up @@ -214,20 +226,20 @@ request_route {
# main route with limited processing
...
# MOH queue?
if (mohq_process()) {
xlog("L_DBG", "Handled by mohqueue");
if (mohq_process ()) {
xlog ("L_DBG", "Handled by mohqueue");
exit;
}
# An error or not a MOH queue message; continue processing
...
}
...

4.2. mohq_send(queue_name)
4.2. mohq_send (queue_name)

Normally calls enter the queue with an initial INVITE message that 1)
has a RURI that matches a queue URI and 2) is passed through
mohq_process(), which is the preferred method.
mohq_process (), which is the preferred method.

This function is used when you wish to send a call into a queue that
does not match the queue URI.
Expand All @@ -244,16 +256,16 @@ request_route {
...
# call is initial INVITE and ready for queue?
if (some test) {
if (mohq_send("main")) {
xlog("L_DBG", "Sent call to main mohqueue");
if (mohq_send ("main")) {
xlog ("L_DBG", "Sent call to main mohqueue");
exit;
}
# failed to enter queue!
...
}
...

4.3. mohq_retrieve(queue_name, URI)
4.3. mohq_retrieve (queue_name, URI)

Retrieves the oldest call in a queue and redirects it to a URI.
Although the function returns, the transfer of the call may not have
Expand All @@ -274,14 +286,14 @@ request_route {
#!define CGROUP "sip:operators@10.211.64.5"
...
# redirect oldest call to operator call group
if (mohq_retrieve(MOHQNAME, CGROUP)) {
xlog("L_DBG", "Retrieved call from mohqueue");
if (mohq_retrieve (MOHQNAME, CGROUP)) {
xlog ("L_DBG", "Retrieved call from mohqueue");
exit;
}
# queue is empty or something went wrong
...

4.4. mohq_count(queue_name, pvar)
4.4. mohq_count (queue_name, pvar)

Finds the number of calls that are in a queue. It will not count calls
that are in the process of entering or exiting the queue.
Expand All @@ -299,9 +311,9 @@ request_route {
$var(mohq) = "operators";
...
# more than 10 calls?
mohq_count("$var(mohq)", "$var(mohqcnt)");
mohq_count ("$var(mohq)", "$var(mohqcnt)");
if ($var(mohqcnt) > 10) {
xlog("L_WARN", "$var(mohq) queue has $var(mohqcnt) calls!");
xlog ("L_WARN", "$var(mohq) queue has $var(mohqcnt) calls!");
}
...

Expand Down Expand Up @@ -402,3 +414,36 @@ $var(mohq) = "operators";

See RTP Audio Video Profile for more information about RTP payload
types.

7. RPC Commands

7.1. mohqueue.debug
7.2. mohqueue.drop_call

7.1. mohqueue.debug

Turns debugging on or off for a queue. The first paramater is the queue
name and the second is a number indicating whether debugging should be
turned off or on (0=off, <>0=on).

Example 1.9. rpc.debug usage:
...
# enable debugging on the test queue
rpc.debug test 1
# disable debugging on the main queue
rpc.debug main 0
...

7.2. mohqueue.drop_call

Drops a call from a queue. The first paramater is the queue name and
the second is the call ID. Using a call ID of "*" (asterisk) drops all
calls from the queue.

Example 1.10. rpc.drop_call usage:
...
# drop all calls from the test queue
rpc.drop_call test *
# drop a call from the main queue
rpc.drop_call main 3807f84e-f1a860fd-db1d09d4@192.168.137.82
...

0 comments on commit 0f61923

Please sign in to comment.