Tools are provided to provision and verify data mappings for the LocationBasedDialling feature.
lbd-provision
This tool takes a .csv file as input and populates the location_based_dialling_data_3gpp
table in Cassandra with the data.
Mandatory Arguments | What it specifies |
---|---|
-c |
Comma separated list of Cassandra contact points. |
Optional Arguments |
What it specifies |
-p |
Cassandra port (defaults to 9042 if omitted). |
-l |
Cassandra local datacenter (defaults to datacenter1 if omitted). |
-f |
Input CSV file. |
-d |
Dryrun, no data in Cassandra will be modified. |
-i |
Reset, all existing data in Cassandra will be removed and replaced with the data in the input file. |
-b |
Rollback, second most recent stored data will be restored. |
-h |
Help |
-u |
Username for Cassandra authentication. When using this option you will be prompted for the password. |
-v |
Verbose output. |
The input CSV file must be comma separated with no header row.
Each line should be in the following format <cell-id>,<dialled-number>,<destination-number>
.
Whitespaces and empty lines are ignored.
Valid characters for dialled-number
and destination-number
entries are: 0-9
, #
, and *
;
a +
character is also allowed at the start of each number.
lbd-provision
will fetch the existing data in cassandra and perform a diff with the content of the input CSV file.
New entries in the input file not present in the database are added.
Current entries not in the input file are removed.
If the -i
option is used, all data currently in the database is removes and all data in the input file is then added.
Each time lbd-provision
is run the dataset is stored in the location_based_dialling_uploaded_files
table.
The -b
option can be used to rollback to the previous data set.
The location_based_dialling_uploaded_files
table has to have been loaded with previous runs of lbd-provision
before rollback can be used.
If -b
is run twice, the original record set is returned, so effectively it toggles between the current and previous data sets.
If the -b
option is not used, -f
must be provided.
Here is an example:
$ cat lbd-provision-test-data.csv testdata0,717,4165550000 testdata1,718,4165550001 testdata2,719,4165550002 $ $ ./lbd-provision -c localhost -f lbd-provision-test-data.csv -i Saving Cassandra contact points: localhost Saving input file: /home/ubuntu/lbd-provision-test-data.csv Setting reset flag Connected to Cassandra Sorted file to: /home/ubuntu/work/input-sorted.csv Processing input file to update Cassandra: /home/ubuntu/work/input-sorted.csv Creating entry: testdata0,717,4165550000 Creating entry: testdata1,718,4165550001 Creating entry: testdata2,719,4165550002 Removing all data from table: location_based_dialling_data_3gpp Creating data in: location_based_dialling_data_3gpp Updated Cassandra with entire input file Not deleting old rows as less than 3 files saved SUCCESS
![]() |
The lbd-provisioning tool can provision up to 5 million rows. Functionality beyond this number of rows is not supported. |
lbd-verify
This tool checks the existing data in Cassandra against the Vertical Service Code profiles in Rhino to ensure that each dialled number that appears in the Cassandra database has a corresponding profile in the Vertical Service Code address list.
Mandatory Arguments | What it specifies |
---|---|
-c |
Comma separated list of Cassandra contact points. |
-r |
Rhino client directory. |
Optional Arguments |
What it specifies |
-p |
Cassandra port (defaults to 9042 if omitted). |
-l |
Cassandra local datacenter (defaults to datacenter1 if omitted). |
-u |
Username for Cassandra authentication. When using this option you will be prompted for the password. |
-m |
Using this option will cause to tool to automatically add any missing entries to the Rhino Vertical Service Code profile table. |
-v |
Verbose output. |
-h |
Help |
It will report on two possible issues types:
-
There are dialled numbers in the Cassandra database that do not have a corresponding Vertical service code profile in Rhino, meaning Location Based Dialling will not be invoked when the number is dialled.
-
There are Vertical Service Code profiles in Rhino configured to invoke Location Based Dialling that do not have any corresponding entries in the Cassandra database, meaning Location Based Dialling will always fall back to the default behaviour when the number is dialled.
Using the -m
option will automatically add any missing entries to the Rhino Vertical Service Code profile table,
solving instances of the first type of issue.
The second type of issue will need to be resolved manually by removing the corresponding profiles from the Vertical Service Code Address List Entry table in Rhino.
Here is an example:
$ ./lbd-verify -c localhost -r RhinoSDK/client Saving Cassandra contact points: localhost Saving rhino client: /home/ubuntu/RhinoSDK/client Connected to Cassandra Found dialled number: 717 Found dialled number: 718 Found dialled number: 719 Found platformOperator: Metaswitch Found address: 718 Found address: 717 Found address: 719 SUCCESS: All data in Cassandra and profiles matches