PSTN to SIP pass-through to a single SIP destination

This example shows a straight pass-through between PSTN calling/called numbers and SIP To/From headers to a single SIP destination.

Note: For simplicity, this example assumes that all inbound calls using TEL URIs are PSTN calls and that SIP calls never use TEL URIs. In cases where the gateway needs to match inbound PSTN calls and inbound SIP calls that use TEL URIs to different routes, you must define separate routing profiles. See the Inbound protocol parameter in General routing profile parameters.

ID

Profile

Incoming Called party

Incoming Calling party

Outgoing Called party

Outgoing Calling party

1

Default

tel:(\d+)

tel:(\d+)

sip:$1@hostname.com

sip:$1@gateway

2

Default

sip:(\d+)@.*

sip:(\d+)@.*

tel:$1

tel:$1

The following rules are used in this example:

Rule

Description

1

Matches and captures all digits (at least 1) from PSTN calling/called numbers, and inserts the digits into SIP From/To headers.

2

Matches a sip: URI in From/To headers, captures all digits before @, and inserts the digits into PSTN calling/called numbers.

Sample Input/Output: Incoming PSTN call (rule 1 match)

Calling: tel:8479258900 => sip:8479258900@gateway

Called:  tel:5082711000 => sip:5082711000@hostname.com

Sample Input/Output: Incoming SIP call (rule 2 match)

From: sip:8479258900@10.3.6.9 => tel:8479258900

To: sip:5082711000@10.3.6.1 => tel:5082711000

Sample Input: No match

From: sip:8479258900@10.3.6.9 => tel:8479258900

To: sip:bob@10.3.6.1 => No match, because the SIP matching pattern requires at least one digit.