Posts Tagged ‘asterisk’

OpenSER/OpenSIPS is well known as a robust, powerful SIP server. But one big lack of OpenSER/OpenSIPS is that it doesn’t have a gateway interface to PSTN network. In this case, you’ll have some options. You can use a router with an FXS/FXO card or using Asterisk with Digium cards as a gateway server.

If you’re choosing to use Asterisk with Digium cards as a gateway server, you’ll need to route certain calls destination (such as to PSTN) to this server to be forwarded to PSTN network later. To add a route in OpenSER/OpenSIPS, you can edit openser.cfg or opensips.cfg.

Don’t be afraid editing these files, but don’t forget to always make a backup 😀

Openser.cfg or opensips.cfg consists of four main parts:

Global parameter

This section is used to set common configuration such as logging, debugging, fork

Module loading

OpenSER/OpenSIPS modules will be loaded here

Module parameter

Each module have parameters which will be configured here

Routing

Routing section is used to configure routing of incoming SIP messages

Route certain calls will be added in routing section. Because SIP uses INVITE to initiate a call, you’ll need to find this line:

# account only INVITEs

if (is_method(“INVITE”)) {

setflag(1); # do accounting

}

We will use prefix based routing to difference calls. For example, if you use destination number with prefix of 8 to be routed to Asterisk with IP address 192.168.1.1, the routing script will be like this:

if (is_method(“INVITE”)) {

if(uri=~”^sip:[8] @*”) {

rewritehostport(“192.168.1.1:5060”);

route(1);

}

setflag(1); # do accounting

}

The function rewritehostport is used to replace the destination host and port of an SIP message header. The uri=~”^sip:[8] @*” will be match to any calls to destination number with prefix of 8 and any SIP server host.

Better try to know more 😀

OpenSIPS is implementation of SIP server based on RFC 3261. OpenSIPS is a robust SIP server which has powerful-customized routing engine. OpenSIPS components implemented as modular element which are not depends each other. OpenSIPS is formerly the Openser -Open SIP Express Router. The Openser project stops and continue into two branches: OpenSIPS (Open SIP Server) and Kamailio. Both new projects are mainly has the same components as Openser.

We will discuss Opensips this time -Kamailio next time maybe 😀 .

Opensips will be fits in these scenarios:

  • VoIP service providers (residential)
  • SIP trunking
  • SIP load-balancing
  • SIP front-end (for SIP termination)
  • white-label solutions
  • enterprise services
  • SIP router (LCR for multi GWs)

Opensips can play many roles in VoIP network:

  • SIP registrar server
  • SIP router / proxy (lcr, dynamic routing, dialplan features)
  • SIP redirect server
  • SIP presence agent
  • SIP IM server (chat and end-2-end IM)
  • SIP to SMS gateway (bidirectional)
  • SIP to XMPP gateway for presence and IM (bidirectional)
  • SIP load-balancer or dispatcher
  • SIP front end for gateways/asterisk
  • SIP NAT traversal unit
  • SIP application server

OpenSIPS has much more features compared with another SIP server. Full documentation about OpenSIPS features can be found here. Mainly, these are the OpenSIPS features

  • robust and performant SIP (RFC3261) Registrar server, Location server, Proxy server and Redirect server
  • support for UDP/TCP/TLS/SCTP transport layers
  • IPv4 and IPv6
  • IP Blacklists
  • flexible and powerful scripting language for routing logic
  • management interface via FIFO file and unix sockets
  • authentication, authorization and accounting (AAA) via database (MySQL, Postgress, text files), RADIUS and DIAMETER
  • digest and IP authentication
  • Presence Agent support (many additional integration features)
  • XCAP support for Presence Agent
  • SNMP – interface to Simple Network Management Protocol
  • management interface (for external integration) via FIFO file, XMLRPC or Datagram (UDP or unixsockets)
  • NAT traversal support for SIP and RTP traffic
  • ENUM support
  • PERL Programming Interface – embed your extensions written in Perl
  • Java SIP Servlet Application Interface – write Java SIP Servlets to extent your VoIP services and integrate with web services
  • load balancing with failover
  • modular architecture – plug-and-play module interface to extend the server’s functionality
  • gateway to sms (AT based)
  • multiple database backends – MySQL, PostgreSQL, Oracle, Berkeley, flat files and other database types which have unixodbc drivers
  • XMPP gateway-ing ( transparent server-to-server translation)
  • OpenSIPS can run on embedded systems, with limited resources – the performances can be up to hundreds of call setups per second
  • used a load balancer in stateless mode, OpenSIPS can handle over 5000 call setups per second
  • on systems with 4GB memory, OpenSIPS can serve a population over 300 000 online subscribers

OpenSIPS deal with low resource usage, but still hampered in interconnection to PSTN network. Unlike Digium which give full support to Asterisks as PSTN gateway with Digium cards, OpenSIPS doesn’t have that support yet. But OpenSIPS developer still working hard to make interconnection to PSTN network possible with OpenSIPS.

Let’s hope their work finish soon…  😀

Sign up for PayPal and start accepting credit card payments instantly.

Menginstall FreePBX saat ini bukan hal yang rumit, apalagi dengan adanya Trixbox yang saat ini sudah merilis versi 2.6. Namun satu hal yang tidak didapatkan pada instalasi “FreePBX distro”, istilah yang saya gunakan untuk menyebut bundel Linux + FreePBX, adalah GUI pada sistem Linux. Kita bisa saja menambahkan GNOME atau KDE pada Centos, bawaan Trixbox 2.6. Namun hal tersebut tidaklah mudah.

Alasan itulah yang sampai saat ini membuat instalasi manual FreePBX masih menjadi pilihan. Instalasi FreePBX secara manual lumayan rumit dan tidak selalu berhasil (untuk instalasi inysaallah saya bahas lain kesempatan,hehehe,,,). Kalaupun berhasil, masih ada beberapa bug yang harus diperbaiki secara manual. Bug yang sering saya alami pada saat menginstal FreePBX 2.3 maupun 2.4 adalah pada Flash Operator Panel (FOP). Versi 2.5 belum saya coba karena masih release candidate (baca: belum stabil,,  😀 ).

Setelah instalasi FreePBX selesai, kita akan mendapatkan tampilan FOP seperti ini

Nampaknya FOP kita berjalan baik-baik saja, namun sebenarnya tidak. Hal ini telihat dari icon pada tiap-tiap extensi yang selalu berkedip merah-hijau-merah-hijau terus menerus. Padahal user sedang idle. Pada gambar di atas posisi printscreen yang saya ambil saat icon berkedip warna merah. Hal ini ternyata disebabkan adanya bug pada file op_server.pl dan ketidaksesuaian dengan file operator_panel.swf. Jika anda jago pemrograman maka tidak usah membaca kelanjutan tulisan ini 😀

Untuk memperbaikinya, download file op_panel-snapshot.tar.gz di http://www.asternic.org/download.php. Versi stabil dari FOP selalu dituliskan dengan nama op_panel-snapshot. Extrak file ini kemudian ambil file op_server.pl dan operator_panel.swf.

# tar xvfz op_panel-snapshot.tar.gz

Lihat pada folder op_panel-snapshot/ ambil file op_server.pl, dan pada folder op_panel-snapshot/flash/ ambil file operator_panel.swf.

Saya asumsikan instalasi web GUI FreePBX pada direktori /var/www/html, sehingga letak file-file FOP ada pada /var/www/html/panel. Saya sarankan membackup dua file asli dari direktori tersebut, kemudian masukkan op_server.pl dan operator_panel.swf yang baru.

Kemudian edit file /etc/passwd.

# nano /etc/passwd

Temukan baris berikut

asterisk:x:501:501::/home/asterisk:/bin/false
Ubah menjadi

asterisk:x:501:501::/home/asterisk:/bin/bash

Kecuali jika sebelumnya sudah demikian. Simpan dengan menekan tombol ctrl+x.

Restart amportal dan buka FOP di web browser. Bug FOP sudah diperbaiki dan status user ditampilkan dengan benar.

Selamat mencoba, semoga bermanfaat 😀

Jika kita sering bergelut dengan VoIP, terutama dengan asterisk, mungkin tips ini cukup bermanfaat. Belum lama ini saya menemui masalah di asterisk, yaitu bahwa asterisk men-generate fake ring back tone ke calling party. Saya menyadari hal ini ketika mencoba melakukan panggilan dari client SIP ke SIP maupun SIP ke extensi PBX yang sudah terinterkoneksi dengan asterisk. Hasilnya, ring back tone yang terdengar di calling party tidak sinkron dengan bunyi ring pada called party. Hal ini cukup mengganggu karena selain tidak sinkron, ring back tone yang digenerate asterisk ke calling party ternyata terjadi sebelum terminal pada called party berdering.

Untuk mengatasinya mudah saja. Jika kita gunakan FreePBX

atau Trixbox, buka pada tab general. Perhatikan pada field

“Asterisk Dial command options” dan hilangkan option “r”. Option r berfungsi men-generate ringback tone ke calling party.

Namun sayangnya hal ini tidak berfungsi untuk Outbound call atau panggilan keluar asterisk.

Untuk pengguna setia Asterisk + konsole,,,hehehe,,,kita bisa hilangkan option r pada baris berikut

exten => 1001,1, Dial(SIP/1001,30,tr)

exten => 1001,2,Hangup

menjadi

exten => 1001,1, Dial(SIP/1001,30,t)

exten => 1001,2,Hangup

Semoga bermanfaat 😀