Phone number handling and input manipulation

GOnnect handles phone numbers in numerous areas throughout the system. This chapter outlines the processing logic and explains how it can be configured. Additionally, it describes how to modify search field inputs using regular expressions to enable additional functionality.

Finding a contact by its phone number

The PBX should always send a number that can be called back. This would, for example, also include a required trunk prefix. Since such a number cannot be looked up in a phonebook, GOnnect provides the following settings to modify it prior to a lookup.

Generally, three leading zeros will be replaced by a plus sign. This is not configurable.

number After

000496990009872

+496990009872

There are also two configuration options to manipulate national and regional prefixes. They will be applied only, if configured.

Example 1. Configuration
[generic]
nationalPrefix=+49
regionalPrefix=+4969

Two leading zeros are replaced by the nationalPrefix and a single leading zero is replaced by the regionalPrefix.

Table 1. Results for the upper config
Before After

006990009872

+496990009872

090009872

+496990009872

Change the text in the search field before searching

You can define so-called "pre-search replacers" to adjust the search term in certain situations. This lead to different search results and therefore also to different digits, which should be dialed or to different room names which should be opened.

The definition is done by setting a configuration with an in and an out value like so:

[pre_search_replacerX]
in=<regex>
out=<value>

The section name starts with pre_search_replacer and is followed by a number. This can be useful, for example, for accommodating company-specific configurations of the phone system or video conferencing.

The section must contain an in and out value. The in value contains a regular expression that matches the input to be replaced. The out value contains the replacement.

The regular expression may contain capturing groups, which can be referenced in the out value. As GOnnect uses QSettings, backslashes must be doubled.

Example 2. Pre-Search Replacer
# Extract the room name from an URL of the own Jitsi instance
# (assuming the own instance runs at "https://meet.jit.si").
# This allows opening the room in GOnnect from a pasted URL.
[pre_search_replacer0]
# A caputre group is defined with the content after the base URL.
in=^https://meet.jit.si/(.*)$
# The value of the first capture group is returned.
out=\\1

# Sometimes phone numbers are written with a zero in parenthesis
# between country code and regional prefix like so: +49 (0) 69 90009872
# To allow pasting such a number, you can use this replacer.
[pre_search_replacer1]
# Match on literal "+49 (0)"
in=^\\+49 \\(0\\)
# Replace with literal "+49"
out=+49