IMC module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module offers support for instant message conference. It follows the architecture of IRC channels, you can send commands embedded in MESSAGE body, because there are no SIP UA clients which have GUI for IM conferencing.
You have to define an URI corresponding to im conferencing manager, where user can send commands to create a new conference room. Once the conference room is created, users can send commands directly to conferece’s URI.
To ease the integration in the configuration file, the interpreter of the IMC commands are embeded in the module, from configuration poin of view, there is only one function which has to be executed for both messages and commands.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- mysql.
- tm.
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- None.
Exported Parameters
Section titled “Exported Parameters”db_url (str)
Section titled “db_url (str)”The database url.
The default value is “mysql://opensips:opensipsrw@localhost/opensips”.
...modparam("imc", "db_url", "dbdriver://username:password@dbhost/dbname")...rooms_table (str)
Section titled “rooms_table (str)”The name of the table storing IMC rooms.
The default value is “imc_rooms”.
...modparam("imc", "rooms_table", "rooms")...members_table (str)
Section titled “members_table (str)”The name of the table storing IMC members.
The default value is “imc_members”.
...modparam("imc", "rooms_table", "members")...hash_size (integer)
Section titled “hash_size (integer)”The power of 2 to get the size of the hash table used for storing members and rooms.
The default value is 4 (resultimg in hash size 16).
...modparam("imc", "hash_size", 8)...imc_cmd_start_char (str)
Section titled “imc_cmd_start_char (str)”The character which indicates that the body of the message is a command.
The default value is ”#“.
...modparam("imc", "imc_cmd_start_char", "#")...outbound_proxy (str)
Section titled “outbound_proxy (str)”The SIP address used as next hop when sending the message. Very useful when using OpenSIPS with a domain name not in DNS, or when using a separate OpenSIPS instance for imc processing. If not set, the message will be sent to the address in destination URI.
Default value is NULL.
...modparam("imc", "outbound_proxy", "sip:opensips.org;transport=tcp")...Exported Functions
Section titled “Exported Functions”imc_manager()
Section titled “imc_manager()”Handles Message method.It detects if the body of the message is a conference command.If so it executes it, otherwise it sends the message to all the members in the room.
This function can be used from REQUEST_ROUTE.
...# the rooms will be named chat-xyz to avoid overlapping# with usernamesif(is_method("MESSAGE) && (uri=~ "sip:chat-[0-9]+@" || (uri=~ "sip:chat-manager@") imc_manager();...Exported MI Functions
Section titled “Exported MI Functions”imc_list_rooms
Section titled “imc_list_rooms”Lists of the IM Conferencing rooms.
Name: imc_list_rooms
Parameters: none
MI FIFO Command Format:
:imc_list_rooms:_reply_fifo_file_ _empty_line_imc_list_members
Section titled “imc_list_members”Listing of the members in IM Conferencing rooms.
Name: imc_list_members
Parameters:
- room : the room for which you want to list the members
MI FIFO Command Format:
:imc_list_members:_reply_fifo_file_ _room_ _empty_line_Exported Statistics
Section titled “Exported Statistics”active_rooms
Section titled “active_rooms”Number of active IM Conferencing rooms.
IMC Commands
Section titled “IMC Commands”A command is identified by the starting character. A command must be written in one line. By default, the starting character is ’#’. You can change it via “imc_cmd_start_char” parameter.
Next picture presents the list of commands and their parameters.
...
1.create -creates a conference room -takes 2 parameters: 1) the name of the room 2)optional- "private" -if present the created room is private and new members can be added only though invitations -the user is added as the first member and owner of the room -eg: #create chat-000 private
2.join -makes the user member of a room -takes one optional parameter - the address of the room -if not present it will be considered to be the address in the To header of the message -if the room does not exist the command is treated as create -eg:join sip:chat-000@opensips.org, or just, #join, sent to sip:chat-000@opensips.org
3.invite -invites a user to become a member of a room -takes 2 parameters: 1)the complete address of the user 2)the address of the room -if not present it will be considered to be the address in the To header of the message -only certain users have the right to invite other user: the owner and the administrators -eg: #invite sip:john@opensips.org sip:chat-000@opensips.org or #invite john@opensips.org sent to sip:chat-000@opensips.org
4.accept -accepting an invitation -takes one optional parameter - the address of the room - if not present it will be considered to be the address in the To header of the message -eg: #accept sip:john@opensips.org
5.deny -rejects an invitation -the parameter is the same as for accept
6.remove -deletes a member from a room -takes 2 parameters: 1)the complete address of the member 2)the address of the room -if not present it will be considered to be the address in the To header of the message -only certain members have the right to remove other members -eg: #remove sip:john@opensips.org, sent to sip:chat-000@opensips.org
7.exit -leaving a room -takes one optional parameter - the address of the room - if not present it will be considered to be the address in the To header of the message -if the user is the owner of the room, the room will be destroyed
8.destroy -removing a room -the parameter is the same as for exit -only the owner of a room has the right to destroy it
9.list -list members in a room
...Installation
Section titled “Installation”Before running OpenSIPS with IMC, you have to setup the database tables where the module will store the data. For that, if the tables were not created by the installation script or you choose to install everything by yourself you can use the imc-create.sql SQL script in the database directories in the opensips/scripts folder as template. You can also find the complete database documentation on the project webpage, http://www.opensips.org/html/docs/db/db-schema-devel.html.
doc copyrights:
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Daniel-Constantin Mierla (@miconda) | 44 | 12 | 1633 | 1036 |
| 2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 40 | 27 | 331 | 573 |
| 3. | Anca Vamanu | 32 | 5 | 3046 | 48 |
| 4. | Liviu Chircu (@liviuchircu) | 12 | 6 | 197 | 222 |
| 5. | Henning Westerholt (@henningw) | 10 | 7 | 83 | 112 |
| 6. | Stefan Darius (@dariusstefan) | 10 | 5 | 376 | 35 |
| 7. | Razvan Crainea (@razvancrainea) | 8 | 6 | 20 | 26 |
| 8. | Elena-Ramona Modroiu | 4 | 2 | 69 | 6 |
| 9. | John Riordan | 3 | 1 | 10 | 5 |
| 10. | Sergio Gutierrez | 3 | 1 | 5 | 2 |
All remaining contributors: Walter Doekes (@wdoekes), Konstantin Bokarius, Edson Gellert Schubert.
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Sep 2011 - Jun 2026 |
| 3. | Bogdan-Andrei Iancu (@bogdan-iancu) | Oct 2006 - Jun 2018 |
| 4. | Liviu Chircu (@liviuchircu) | Mar 2014 - Jun 2018 |
| 5. | Walter Doekes (@wdoekes) | May 2014 - May 2014 |
| 6. | John Riordan | May 2009 - May 2009 |
| 7. | Sergio Gutierrez | Nov 2008 - Nov 2008 |
| 8. | Daniel-Constantin Mierla (@miconda) | Nov 2006 - Mar 2008 |
| 9. | Konstantin Bokarius | Mar 2008 - Mar 2008 |
| 10. | Edson Gellert Schubert | Feb 2008 - Feb 2008 |
All remaining contributors: Henning Westerholt (@henningw), Anca Vamanu, Elena-Ramona Modroiu.
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Liviu Chircu (@liviuchircu), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Anca Vamanu, Henning Westerholt (@henningw), Elena-Ramona Modroiu.
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0