Book Image

Building Telephony Systems with OpenSER

Book Image

Building Telephony Systems with OpenSER

Overview of this book

Table of Contents (18 chapters)
Building Telephony Systems with OpenSER
Credits
About the Author
About the Reviewers
Preface
6
Building the User Portal with SerMyAdmin
Index

Lab—Using Asterisk as a PSTN Gateway


Using the sketch provided in this chapter, write a script to send PSTN calls to a PSTN Gateway. You can use phpMyAdmin, or the MySQL command line to insert data on the database.

Step 1—Add the gateway address in the trusted table using SerMyAdmin:

If desired or convenient, you can instead use the MySQL command line interface to achieve the same result.

#mysql –u openser –p
-- enter your mysql password --
mysql> use openser;
mysql> INSERT INTO trusted ( src_ip, proto, from_pattern ) VALUES ( '10.1.30.22', 'any', '^sip:.*$');

The records above tell the OpenSER script to allow requests coming from the IP address 10.1.30.22 with any transport protocol, matching the regular expression ^sip:.*$. You can use the following command if you don't want to reload OpenSER.

#openserctl fifo trusted_reload

Step 2—Include your served domains in the domain table (if you have not done before).

openserctl domain add sermyadmin.org 

You can also use SerMyAdmin to do...