Playing announcements

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.

Playing demo-thanks

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. ...

Get Building Telephony Systems with OpenSIPS - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.