Na configuração abaixo OpenSIPS não trata o tráfego de áudio/RTP, este é passado diretamente para o servidor Asterisk/A2Billing.
O código a seguir é o todo OpenSIPS.cfg, depois quero adicionar o artigo todo após testado completamente.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
route{ if (!mf_process_maxfwd_header("10") && $retcode==-1) { sl_send_reply("483","Too Many Hops"); exit; } 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(RELAY); } else { if ( is_method("ACK") ) { if ( t_check_trans() ) { t_relay(); exit; } else { exit; } } sl_send_reply("404","Not here"); } exit; } if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; } else if (!is_method("INVITE")) { send_reply("405","Method Not Allowed"); xlog("$rm FAILED: $si / $ct / $fu\n"); exit; } if ($rU==NULL) { sl_send_reply("484","Address Incomplete"); exit; } |
Bom esse é um assunto que um dia espero dar mais detalhes, não é algo comumente utilizado e ou falado, eu diria que é mais coisa de especialistas, mais para operadoras que estão migrando sua telefonia velha “legado” para o novo padrão mundial o SIP, o que posso adiantar é que o opensips é ambicioso, diz que pode manter até 5000CPS ou seja chamadas por segundo e pode ter 3milhões de usuários isso são números bem interessantes e milhares de vezes maiores que o asterisk que foi concebido para outra coisa, não entrarei nesta conversa. Para quem quer saber algumas caracteristicas do opensips abaixo alguns features sobre o mesmo.
Some of the features that OpenSIPS brings:
- robust and performant SIP (RFC3261) Registrar server, Location server, Proxy server and Redirect server
- small footprint – the binary file is small size, functionality can be stripped/added via modules
- plug&play module interface – ability to add new extensions, without touching the core, therefore assuring a great stability of core components
- stateless and transactional statefull SIP Proxy processing
- support for UDP/TCP/TLS/SCTP transport layers
- IPv4 and IPv6
- support for SRV and NAPTR DNS
- SRV DNS failover
- IP Blacklists
- multi-homed (mhomed) and multi-domain support
- flexible and powerful scripting language for routing logic
- variables support in script – script variables, pseudo-variables (access to the SIP messages), AVPs (values persistent per SIP transactions)
- 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
- CPL – Call Processing Language (RFC3880)
- 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
- least cost routing
- support for replication – REGISTER offer new functions for replicating client information (real source and received socket).
- logging capabilities – can log custom messages including any header or pseudo-variable and parts of SIP message structure.
- 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
- straightforward interconnection with PSTN gateways
- dialog support (call monitoring, call termination from proxy side, call profiling)
- XMPP gateway-ing ( transparent server-to-server translation)
- impressive extension repository – over 70 modules are included in OpenSIPS repository
Scalability:
- 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
- system can easily scale by adding more OpenSIPS servers
- OpenSIPS can be used in geographic distributed VoIP platforms
- straightforward failover and redundancy
Gustavo Franco Pabx – Linux – Cisco – Juniper – Asterisk – VoIP – Redes – Telefonia