O'Reilly logo

Building Telephony Systems with OpenSIPS 1.6 by Flavio E. Goncalves

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example

Here is a complete example of how to make calls to the PSTN using the concepts learned until this point.

Example

This script is named 0745_07_01.cfg in the code bundle. The complete code is as shown and the changes from previous scripts are highlighted. This will help you to understand where to insert the new code.

route{ if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; } #---- Sequential requests section ----# if (has_totag()) { if (loose_route()) { if (is_method("BYE")) { setflag(1); # do accounting setflag(3); # even if the transaction fails } else if (is_method("INVITE")) { record_route(); } route(1); } else ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required