To send calls to a media server is not rocket science. All you have to do is rewrite the host and port of the R-URI to the IP address of the media server.
The demo-thanks.gsm
file is a recording present in each Asterisk server that is installed. Let's create a number such as *100 to send a call to the Asterisk server. From now on, each number prefixed by the character, *
, will be sent to the media server. In the route section of the file, insert the following just after the alias processing:
if($rU=~"^\*") { rewritehostport("ip_address_of_the_media_server"); route(1); }
It is very simple; any number starting with *
will be sent to the media server. Now, in the Asterisk server, we have to receive the call. To do this, we will edit the sip.conf
and extensions.conf
files in the /etc/asterisk
directory. Usually, for the purposes of testing and education, we install both Asterisk and OpenSIPS in the same server, OpenSIPS in the port 5060, and Asterisk...