OpenSIPS: dialplan module usage examples

Use case 1:
convert the username consisting of letters in incoming INVITE from your VoIP provider to digits
(e.g. INVITE: rt_user1@192.168.1.203 -> INVITE: 13511654321@192.168.1.203, where country-city-subscriber is 1-3511-654321):

Add to your dialplan table:

So, the SQL record is as follows:

A piece of code from your OpenSIPS config:

We will use sipvicious for tests:

Matching flags (0-case sensitive, 1-case insensitive) – I’ve tested both with 0 and 1 values in ‘match_flags’ column and with sending INVITE with r-uri username in both cases (rt_user1 and rt_usER1), and it worked as desired. Use this if needed.

Here is how the OpenSIPS log looks like:

Use case 2:
convert the username in incoming INVITE from your VoIP provider to e164 format
(e.g. INVITE: +83533444444@192.168.1.203 -> INVITE: 73533444444@192.168.1.203):

Add to your dialplan table (for testing purposes I use a separate dialplan id (dpid)):

The SQL record will look like this:

A piece of code from your OpenSIPS config (for testing purposes I use a separate dialplan id (dpid)):

Sipvicious commands for tests:

OpenSIPS log:

Tags: , ,

Comments are closed.