Pustaka Taratsa

Baca teks (EPUB): VoIP Cookbook: How to route to PSTN and Cellular in OpenSIPS

1 bagian

Teks ini diambil langsung dari berkas EPUB; tata letak dan gambar tidak disertakan. Untuk tampilan lengkap, silakan merujuk pada dokumen asli.

Daftar isi
  1. VoIP Cookbook: How to route to PSTN and Cellular in OpenSIPS
  2. See Also

VoIP Cookbook: How to route to PSTN and Cellular in OpenSIPS

Sumber: https://onnocenter.or.id/wiki/index.php/VoIP_Cookbook:_How_to_route_to_PSTN_and_Cellular_in_OpenSIPS

Basically, we need an Analog Telephone Adapter (ATA) to interconnect a VoIP network to PSTN or Cellular network. In this example, we assume

  • ATA is located at IP address 192.168.0.200
  • ATA is using port 5061
  • Area code for PSTN is 021
  • Area code for Cellullar is 08

We need to add to the opensips configuration file

/usr/local/etc/opensips/opensips.cfg

For example, to be able to use the ATA to call PSTN from all host / domain

# attempt handoff to PSTN 
if (uri=~"^sip:021[0-9]*@*") {
     rewritehostport( "192.168.0.200:5061");  ##  192.168.0.200:5061 is the ATA
     route(1);
     };

To restrict the call to PSTN only from mydomain.com

# attempt handoff to PSTN
if (uri=~"^sip:021[0-9]*@mydomain.com") {     ##  caller registered to mydomain.com
     rewritehostport( "192.168.0.200:5061");  ##  192.168.0.200:5061 is ATA
     route(1);
     };

To be able to use the ATA to call Cellullar from all host / domain

# attempt handoff to cellullar
if (uri=~"^sip:08[0-9]*@*") {
     rewritehostport( "192.168.0.200:5061");  ##  192.168.0.200:5061 is ATA
     route(1);
     };

To restrict the call to Cellular only from mydomain.com

# attempt handoff to cellullar
if (uri=~"^sip:08[0-9]*@mydomain.com") {      ##  caller registered to mydomain.com
     rewritehostport( "192.168.0.200:5061");  ##  192.168.0.200:5061 is ATA
     route(1);
     };

See Also