Introduction
The beroNet Gateway is a modular SIP Gateway, which translates the SIP Protocol according to RFC3261 [1] into the protocols of the following technologies:
- ISDN PRI and BRI, according to the EuroISDN Standards ITU/T Q.931 [2]
- FXO, FXS
- GSM, via a GSM Module according to the ETSI GSM AT commandset [3]
Each technology of these technologies has at least 1 Information Element which contains the caller-id. Since SIP is a rather loosely defined standard. It has several protocol standard, there are different recommendations and drafts which define where in which Header element the caller-ids can or must be present. The following table shows which kind of Information elements or Header Elements are popular and often used in which technology:
technology | caller id options |
---|---|
SIP | Headers: From:, P-Preferred-Identity:, P-Asserted-Identity:, Remote-Party-Id: |
ISDN | Information Elements: OAD, OAD2, QSIG Name |
Analog | Information Elements: Caller ID, Calling Name |
GSM | Information Elements: Caller ID |
Besides the amount of different fields which contain "the" caller-id, there are also additional sub elements or degrees of freedom, which are discussed in the following chapters.
Caller-Id Formats
SIP
Each SIP Header which may contain "the" caller-id has follows the same structure:
- From: "FROM_DISPLAYNAME" <FROM_USER@SERVER>
- P-Asserted-Identity: "PAI_DISPLAYNAME" <PAI_USER@SERVER>
- P-Preferred-Identity: "PPI_DISPLAYNAME" <PPI_USER@SERVER>
In a pure SIP Environment, the DISPLAYNAME part contains the users name as text, the USER part contains either the username, but also often the extensions or caller-id. Most SIP providers use the following mapping:
Header Part | Usage |
---|---|
FROM_USER | Authentication Username |
PAI_USER | caller-id |
PPI_USER | caller-id |
FROM_DISPLAYNAME | not used |
PAI_DISPLAYNAME | not used |
PPI_DISPLAYNAME | not used |
The caller-id itself has also varying possibilities of formatting. The caller-id has typically the following structure:
(international-prefix) (international code) (national code) (base number) (extension)
the most varying element can be the "international-prefix", which is often just a plus "+" sometimes it may also be a double zero "00". The following examples show the varying options for the caller-id "+492593890"
Name | International Prefix | International Code | National Code | Base Number | Extension |
---|---|---|---|---|---|
International Number with plus | + | 49 | 30 | 259389 | 0 |
International Number with double zero | 00 | 49 | 30 | 259389 | 0 |
International Number without prefix | 49 | 30 | 259389 | 0 | |
National Number (note: 0 as National Prefix) | 030 | 259389 | 0 | ||
Unknown Number / Local Number - without prefixes | 259389 | 0 |
Most providers do only accept one of the above variants, in order to display the correct caller-id or even to forward the call at all.
ISDN
In ISDN the OAD and OAD2 fields represent the caller-id. They are comparable to the P-Asserted-Id and P-Preferred-Id Headers in SIP. The OAD Information elements carry additional information about the type of the caller-id. There are the following so called type-of-numbers:
- unknown
- local
- national
- international
Depending on the type of number, the caller-id itself must be in the right format, otherwise the PBX / Carrier displays the wrong caller-id or even doesn't forward the call at all. The following table shows for the caller-id "0049302593890" how the type-of-number affects notation of the caller-id:
Type of Number | Sample Callerid | Description |
---|---|---|
unknwon | 2593890 | caller-id without any prefixes |
local | 2593890 | caller-id without any prefixes |
national | 302593890 | caller-id with national prefix (without leading 0) |
international | 49302593890 | caller-id with international prefix and national prefix (without leading zeroes) |
Gateway Conversion
The beroNet Gateway has also the ability to match dialplan rules against the caller id. It uses the Source in the dialplan for matching and the NewSource to generate the caller id for the outbound technology.
This document describes how to configure the caller id matching and output behaviour of the beroNet Gateway.
...
...
New Dialplan
...
...
New Dialplan
The the beroNet Gateway Dialplan allows to match the dialed Number (Destination) and the Callerid (Source) against Patterns. It also allows to modify the Destination and Callerid, for example to put a prefix (like 0) before a Number. Each Dialplan Rule can carry additional Configuration options that are only valid for this rule. With these tools it is possible to modify the call handling behavior of the beroNet Gateway per Destination Number or per CallerID. One usage example is to enable or disable CLIR per Destination prefix.
Destination
As you can see it is quite simple to say which field in SIP or PSTN is the Destination (To Header and DAD), so there is a simple 1:1 Mapping between the SIP Header "To:" and the PSTN Destination Number DAD. To make it possible to match against certain Destination all incoming calls are first processed by the Dialplan.
If the call comes from SIP, the To: Header is matched against all Dialplan Destination fields. If one line matches the configured CallerID is checked against the Dialplan Source field (see below). If one rule matches, then the PSTN DAD (Destination Address) is filled with NewDestination. The Destination matches with regular expressions and the NewDestination contains the results.
...
The Dialplan Source Setting coming From SIP is editable under "more":
the Default Setting is "from_user" which means that the beroNet Gateway will use the from_user SIP Header as it's Diaplan Source.
If the call comes from sip there are other SIP Headers: from_display, from_user, p-asserted-identy, p-preferred-identy or Remote-Party-Id which can carry the callerid. You can choose to use those fields in the dialplan-source Setting.
Source (to SIP)
In the Direction towards SIP, you can also define which SIP Header contains which Information. Normally the Callerid is contained in the NewSource in the Dialplan, so you want to use NewSource as the SIP Header which is understood as Callerid at the Remote Party.
The SIP Headers which contain the callerid as default are: From_User and From_Display. Sometimes, especially when the beroNet Gateway is registered at a remote SIP Server the From_User needs to be identical with the Username, so you need to set the From_User to "Account_Username". In those cases you still have some SIP Headers left to transmit the callerid: from_display, p-asserted-identy (user,display), p-preferred-identy(user,display) or Remote-Party-Id (user,display).
...
If the call comes from isdn the callerid is in most cases carried in the oad (originator address) field.
Callerid Restriction/ Anonymity and Privacy
...