Table of Contents
hash_size
(integer)presence_server
(string)watchers_avp_spec
(string)shared_line_spec_param
(string)appearance_name_addr_spec_param
(string)db_url
(string)db_mode
(integer)table_name
(string)shared_line_column
(string)watchers_column
(string)app[index]_shared_entity_column
(string)app[index]_call_state_column
(string)app[index]_call_info_uri_column
(string)app[index]_call_info_appearance_uri_column
(string)appindex_b2bl_key_column
(string)List of Tables
List of Examples
hash_size
parameterpresence_server
parameterwatchers_avp_spec
parametershared_line_spec_param
parameterappearance_name_addr_spec_param
parameterdb_url
parameterdb_mode
parametertable_name
parametershared_line_column
parameterwatchers_column
parameterapp[index]_shared_entity_column
parameterapp[index]_call_state_column
parameterapp[index]_call_info_uri_column
parameterapp[index]_call_info_appearance_uri_column
parameterapp[index]_b2bl_key_column
parametersca_init_request()
usageThis module provides core SCA (Shared Call Appearance) functionality for OpenSIPS. It is designed to work in tandem with the presence_callinfo module.
The module handles the basic SIP signalling for call controll while publishing callinfo events to a presence server. It is built on top of the b2b_logic module and it is using the 'top hiding' scenario to control SIP signalling.
A typical usage example is provided below, where Alice makes a call to Bob. The call leg between Alice and the b2b_sca server is an "appearance" call of the "shared" call between the b2b_sca server and Bob.
caller caller b2b_sca callee presence server alice1@example alice2@example server bob@example watcher@example | | | | | |--INV bob------------------>| | | | | |--INV bob->| | | | |--PUBLISH(alerting)--->| | | |<-----200 OK-----------| | | | | | | | |<-180 ring-| | |<-180 ring------------------| | | | | | | | | | | | | | | |<-200 OK---| | |<-200 OK--------------------|--ACK----->| | |--ACK---------------------->|--PUBLISH(active)----->| | | |<-----200 OK-----------| | | | | | |--INV bob (hold)----------->| | | | | |--INV bob->| | | | |--PUBLISH(held)------->| | | |<-----200 OK-----------| | | |<-200 OK---| | |<--200 OK-------------------| | | | | | | | | |--INV------->| | | | | |--INV bob->| | |<-BYE-----------------------|--PUBLISH(active)----->| |--200 OK------------------->|<-----200 OK-----------| | | |<-200 OK---| | | |<-200 OK-----| |
Alice calls Bob from her desk IP phone (alice1).
Bob answers the call.
Alice decide to carry the conversation from a meeting room and she put's BOB on hold.
Alice arrives to the meeting room and retrieves the call on the conference room IP phone (alice2).
Features to be added in the future:
possibility to handle unlimited number of appearances.
The size of the hash table internally used to keep the shared calls. A larger table means faster acces at the expense of memory. The hash size is a power of number two.
The default value is "10".
The address of the presence server, where the PUBLISH messages should be sent (not compulsory). If not set, the PUBLISH requests will be routed based on watcher's URI.
The default value is "NULL".
Example 1.2. Set presence_server
parameter
... modparam("b2b_sca", "presence_server", "sip:opensips.org") ...
AVP that will hold one or more watcher URI(s). If not set, no PUBLISH requests will be sent out. The watchers_avp_spec MUST be set before calling sca_init_request();
The default value is "NULL".
Example 1.3. Set watchers_avp_spec
parameter
... modparam("b2b_sca", "watchers_avp_spec", "$avp(watchers_avp_spec)") ... route { ... $avp(watchers_avp_spec) = "sip:first_watcher@opensip.org"; $avp(watchers_avp_spec) = "sip:second_watcher@opensip.org"; ... }
Mandatory parameter. Opaque string identifing the shared line/call. The shared_line_spec_param MUST be set before calling sca_init_request();
The default value is "NULL".
Example 1.4. Set shared_line_spec_param
parameter
... modparam("b2b_sca", "shared_line_spec_param", "$var(shared_line)") ...
Mandatory parameter. It must be a valid SIP URI. It will populate the appearance-uri SIP parameter inside the Call-Info SIP header. The appearance_name_addr_spec_param MUST be set before calling sca_init_request();
The default value is "NULL".
Example 1.5. Set appearance_name_addr_spec_param
parameter
... modparam("b2b_sca", "appearance_name_addr_spec_param", "") ...
This is URL of the database to be used.
The default value is "NULL".
Example 1.6. Set db_url
parameter
... modparam("b2b_sca", "db_url", "[dbdriver]://[[username]:[password]]@[dbhost]/[dbname]") ...
The b2b_sca module can utilize database for persistent call appearance storage. Using a database ensure that active call appearances will survive machine restarts or SW crashes. The following databse accessing modes are available for b2b_sca module:
The default value is 0 (NO DB STORAGE).
Identifies the table name from the defined database.
The default value is "b2b_sca".
The column's name in the database storing the shared call/line id. See "shared_line_spec_param" parameter.
The default value is "shared_line".
The column's name in the database storing the list of watchers. See "watchers_avp_spec" parameter.
The default value is "watchers".
The column's name in the database storing the shared entity of a particular appearance. See "sca_init_request" for more info.
The default value is "app[index]_shared_entity". Index is an integer between 1 and 10.
Example 1.11. Set app[index]_shared_entity_column
parameter
... modparam("b2b_sca", "app1_shared_entity_column", "first_shared_entity") modparam("b2b_sca", "app2_shared_entity_column", "second_shared_entity") ...
The column's name in the database storing the call state of a particular appearance. The following states are stored:
The default value is "app[index]_call_state". Index is an integer between 1 and 10.
Example 1.12. Set app[index]_call_state_column
parameter
... modparam("b2b_sca", "app1_call_state_column", "first_call_state") modparam("b2b_sca", "app2_call_state_column", "second_call_state") ...
The column's name in the database storing the call info URI of a particular appearance.
The default value is "app[index]_call_info_uri". Index is an integer between 1 and 10.
Example 1.13. Set app[index]_call_info_uri_column
parameter
... modparam("b2b_sca", "app1_call_info_uri_column", "first_call_info_uri") modparam("b2b_sca", "app2_call_info_uri_column", "second_call_info_uri") ...
The column's name in the database storing the call info appearance URI of a particular appearance. For each appearance, the value is extracted from the "appearance_name_addr_spec_param" parameter.
The default value is "app[index]_call_info_appearance_uri". Index is an integer between 1 and 10.
Example 1.14. Set app[index]_call_info_appearance_uri_column
parameter
... modparam("b2b_sca", "app1_call_info_appearance_uri_column", "first_call_info_appearance_uri") modparam("b2b_sca", "app2_call_info_appearance_uri_column", "second_call_info_appearance_uri") ...
The column's name in the database storing the b2b_logic key of a particular appearance.
The default value is "app[index]_b2bl_key". Index is an integer between 1 and 10.
Example 1.15. Set app[index]_b2bl_key_column
parameter
... modparam("b2b_sca", "app1_b2bl_key_column", "first_b2bl_key") modparam("b2b_sca", "app2_b2bl_key_column", "second_b2bl_key") ...
This is the function that must be called by the script writer on an initial INVITE for which an SCA call must be instantiated (see the call from alice1 in the above diagram).
Meaning of the parameters:
shared_line (int) - an integer identifying the call leg as being an "appearnace" call or a "shared" call:
0: "shared" call
1: "appearance" call
Example 1.16. sca_init_request()
usage
... modparam("b2b_sca", "shared_line_spec_param","$var(shared_line)") modparam("b2b_sca", "appearance_name_addr_spec_param","$var(appearance_name_addr)") modparam("b2b_sca", "watchers_avp_spec","$avp(watchers_avp_spec)") ... # Setting the shared call identifier $var(shared_line) = "alice"; # Setting the watchers $avp(watchers_avp_spec) = "sip:alice1@example.com"; $avp(watchers_avp_spec) = "sip:alice2@example.com"; if (INCOMING_SHARED_CALL) { # The incoming call is a 'shared' call $var(shared_line_entity) = 0; # Setting the appearance name address $var(appearance_name_addr) = $fu; } else { # The incoming call is an 'appearance' call # - see Alice's initial call leg in the given example $var(shared_line_entity) = 1; # Setting the appearance name address $var(appearance_name_addr) = $tu; } # Initiate the call if (!sca_init_request($var(shared_line_entity))) { send_reply(403, "Internal Server Error (SLA)"); exit; } ...
This is the function that must be called by the script writer on an initial "appearance" INVITE for an existing shared call. It will bridge the current "appearance" call with the existing "shared" call and the old "appearance" call will be disconnected (see the call from alice2 in the above diagram).
Meaning of the parameters:
shared_line_to_bridge (string) - a string identifying the shared line/call that was previously set by sca_init_request().
... if ($rU==NULL && is_method("INVITE") && $fU==$tU && is_present_hf("Call-Info")) { # The incoming call is an 'appearance' call # - see Alice's call from alice2 in the given example $var(shared_line_to_bridge) = "alice"; if (!sca_bridge_request($var(shared_line_to_bridge))) send_reply(403, "Internal SLA Error"); exit; } } ...
Table 2.1. Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
Name | DevScore | Commits | Lines ++ | Lines -- | |
---|---|---|---|---|---|
1. | Ovidiu Sas (@ovidiusas) | 33 | 2 | 3536 | 2 |
2. | Liviu Chircu (@liviuchircu) | 13 | 10 | 63 | 67 |
3. | Razvan Crainea (@razvancrainea) | 12 | 10 | 32 | 28 |
4. | Bogdan-Andrei Iancu (@bogdan-iancu) | 9 | 7 | 13 | 13 |
5. | Vlad Patrascu (@rvlad-patrascu) | 8 | 5 | 82 | 90 |
6. | Maksym Sobolyev (@sobomax) | 5 | 3 | 5 | 7 |
7. | Ezequiel Lovelle (@lovelle) | 3 | 1 | 1 | 1 |
8. | Peter Lemenkov (@lemenkov) | 3 | 1 | 1 | 1 |
(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. Regarding imported patches/code, we do our best to count the work on behalf of the proper owner, as per the "fix_authors" and "mod_renames" arrays in opensips/doc/build-contrib.sh. If you identify any patches/commits which do not get properly attributed to you, please submit a pull request which extends "fix_authors" and/or "mod_renames".
(3) ignoring whitespace edits, renamed files and auto-generated files
Table 2.2. Most recently active contributors(1) to this module
Name | Commit Activity | |
---|---|---|
1. | Maksym Sobolyev (@sobomax) | Oct 2022 - Feb 2023 |
2. | Liviu Chircu (@liviuchircu) | Mar 2014 - Nov 2022 |
3. | Razvan Crainea (@razvancrainea) | Aug 2015 - Feb 2022 |
4. | Bogdan-Andrei Iancu (@bogdan-iancu) | May 2014 - Mar 2020 |
5. | Vlad Patrascu (@rvlad-patrascu) | May 2017 - Apr 2019 |
6. | Peter Lemenkov (@lemenkov) | Jun 2018 - Jun 2018 |
7. | Ovidiu Sas (@ovidiusas) | Dec 2013 - Feb 2016 |
8. | Ezequiel Lovelle (@lovelle) | Oct 2014 - Oct 2014 |
(1) including any documentation-related commits, excluding merge commits
Last edited by: Vlad Patrascu (@rvlad-patrascu), Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu), Ovidiu Sas (@ovidiusas).
Documentation Copyrights:
Copyright © 2011-2013 VoIP Embedded, Inc.