Monday, December 28, 2009

Best of New in Kamailio 3.0.0 - #9: event_route

The event_route is offering a framework for developers to give script writers more control when special events happen. Unlike the other routing blocks which were designed to process SIP messages, the event_route can be triggered by a non-SIP-related event as well.

An example is event_route[htable:mod-init] which is executed by htable module when it is initialized. Practically, the event_route is executed once, when Kamailio (OpenSER) starts. The main goal for event_route[htable:mod-init] is to allow initializations at startup -- can be variables from htable or other modules.
...  
event_route[htable:mod-init] {
$sht(a=>x) = 1;
$shv(counter) = 0;
sql_query("insert into restarts (start_time) values ('$Tf')");
}
...

Another event_route is exported by tm module: event_route[tm:local-request] - which is executed when tm generates internally and sends a SIP request. Such cases are:
  • SIP messages sent by msilo module
  • SIP messages sent by presence server
  • SIP messages sent by dialog module
  • SIP messages sent via MI or CTL interfaces
Examples of usage:
  • log details about local request
  • account the local request
  • apply filters to local generated requests
...  
event_route[tm:local-request] {
xlog("request [$rm] from [$fu] to [$ru]\n");
}
...
Among the benefits of event_route:
  • new events can be exported and fired by any module
  • no need to extend the config grammar when adding a new event
  • various variables can be made available when the event is fired to be used inside the event_route
  • no need to have SIP message to be processed
For the future I expect several events to be added, for example:
  • when a location contact expires
  • timer-based events (rtimer module to migrate from using route to using event_route blocks)
  • when dialog module sends BYE on timeout
Next episode to be about: topology hiding module.

Wednesday, December 23, 2009

Best of New in Kamailio 3.0.0 - #8: onsend_route

Kamailio (OpenSER) 3.0.0 provides two new routing block types:
  • onsend_route - executed when a SIP request is sent to network
  • event_route - will be presented in the next post of this series
R-URI or routing headers might have domain names and the DNS resolver is hidden behind functions like t_relay() or forward(). Moreover, there is pretty quite complexity in selecting the next hop by strict or loose routing, outbound proxy address and R-URI address which tied with DNS failover made the options to get the destination address in config impossible with older versions.

The newly introduced onsend_route comes to fill the gap. The actions in this routing block are executed just before sending the message to network, meaning:
  • you get access to the buffer with the version of the SIP request that is sent
  • you get access to all attributes of destination address: address family, transport protocol, ip address and port.
A new set of pseudo-variables and keywords are made available:
  • $snd(name), where 'name' can be 'ip', 'af', 'port' or 'proto'- get access via PV to destination's ip address, address family, port or transport protocol. In addition to details of destination address, when name is 'buf' or 'len' you get access to content of output buffer and its length.
  • snd_ip, snd_af, snd_port, snd_proto - same as above about destination address, but implemented as config keywords
Not all functions exported by core or modules are available in onsend_route, however, you can drop the request, access message flags, use transformations over the output buffer and more. msg:len keyword returns the length of the message to be sent, not the length of original message.

The typical usage is to implement outgoing filtering, a good option to protect against DNS poisoning and malicious DNS records:
onsend_route {
if(isflagset(2) && $snd(ip)=="10.10.10.10"){
drop;
}
}

Tuesday, December 22, 2009

VUC Dec 2009: Kamailio - Asterisk

Alex Balashov of Evariste Systems, active community member and contributor of Kamailio (OpenSER), running a VoIP consultancy business in USA, leads a VoIP User Conference about Kamailio, the role of Asterisk, SER and media gateways, etc.

Among topics: relationship of Kamailio to OpenSER project history, what is Kamailio (OpenSER), SIP server (for certain purposes, such as registrar, presence user agent, etc.), common uses of Kamailio, service delivery platform engineering and Asterisk scaling using Kamailio, some discussion of sip-router.org initiative.

Almost 2 hours of recording, going from overview to deep technical concepts, I can even say, a great tutorial about Kamailio in some aspects.

Evariste Systems comes with a big bag of expertise about SIP and SIP Proxy, Kamailio (OpenSER) in particular, being one of the nominations for Kamailio (OpenSER) 2008 Awards and good candidate for 2009.

More details and the podcast available at:

http://www.voipusersconference.org/2009/asterisk-kamaillio/

Monday, December 21, 2009

Best of New in Kamailio 3.0.0 - #7: tls

The most important change, comparing to Kamailio (OpenSER) 1.5.x (or older), in regard to TLS is a new internal architecture - the core is no longer dependent of SSL libraries.

If in older versions, enabling TLS means to recompile everything, with TLS=1 flag for Makefile, in Kamailio (OpenSER) 3.0.0 TLS implementation is provided by a module, named tls.
  • no more two tarballs with sources of Kamailio
  • no more two sets of packages with Kamailio binaries
  • no more need to recompile everything every time when switching between no-TLS and TLS configs
  • compilation of TLS support as simple as compilation of any other module: make modules modules=modules/tls
Yes, now enabling TLS is as simple as just loading a module and configure it via modparam:
...
loadmodule "tls.so"
...
modparam("tls", "certificate", "/etc/kamailio/certificate.pem")
...

Coming as well with support for server name extension, another feature that worth to mention is the option for a dedicated config file for TLS parameters.

...
modparam("tls", "config", "etc/kamailio/tls.cfg")
...

Sample TLS config file:

[server:default]
method = TLSv1
verify_certificate = no
require_certificate = no
private_key = kamailio_key.pem
certificate = kamailio_cert.pem
ca_list = kamailio_ca.pem

[client:default]
verify_certificate = yes
require_certificate = yes

[server:10.0.0.10:5061]
method = SSLv23
verify_certificate = yes
require_certificate = no
private_key = privatenet_key.pem
certificate = privatenet_cert.pem
verify_depth = 3
ca_list = privatenet_ca.pem

[client:10.0.0.11:5061]
verify_certificate = no
certificate = peer_11_client.pem
private_key = peer_11_key.pem
ca_list = peer_11_ca.pem
Check the full list of available parameters for TLS module at:
http://kamailio.org/docs/modules/3.0.x/modules/tls.html

Moreover, the new architecture offers far better performances, as it is reusing lot of TCP enhancements, getting to tens of thousands TLS connections in a single SIP server is easier than ever.

Note that TLS was not updated to work in asynchronous mode, therefore when using TLS configure TCP in non-asynchronous mode (feature planned for next major release).

Next in this series: onsend_route.

Sunday, December 20, 2009

Best of New in Kamailio 3.0.0 - #6: asynchronous tcp

With increasing of instant messaging and presence traffic, ability to handle in a reliable and fast fashion the TCP processing in SIP networks became mandatory.

Thanks to Andrei Pelinescu-Onciul, the one that wrote the first (and the second, and the third, ...) line of code for SIP Express Router (SER) (of course that extends to Kamailio (OpenSER) or other variants), Kamailio 3.0.0 introduces asynchronous TCP processing, via sip-router.org core framework.

You can control synchronous/asynchronous TCP behaviour via global parameter tcp_async:
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#tcp_async

Shortly, asynchronous TCP means that Kamailio worker processes will not block in attempt to open a TCP connection or send a SIP message over a TCP connection. The TCP operations are pooled and handled by special processes, the SIP worker processes moving forward to deal with next SIP messages.

This is not the only improvement to TCP, practically TCP has been refurbished if you compare it with Kamailio 1.5.x or older. A lot of new parameters that help you tune TCP processing performances that came along with a better internal architecture:
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#tcp_parameters

Next post in this series will be about TLS improvements.

Saturday, December 19, 2009

Best of New in Kamailio 3.0.0 - #5: sercmd

Along with Kamailio (OpenSER) 3.0.0 you will get a command line interface: sercmd. Installed on same directory as kamailio binary, sercmd enables admins to connect to running instance of Kamailio, either on same or remote system.

First, you have to load the ctl module in your config, see module's readme:
http://kamailio.org/docs/modules/3.0.x/modules/ctl.html

If you use default configuration in the ctl module and sercmd, with kamailio on the same system, then just launch sercmd.

Among features:
  • command history
  • connection or single command mode
  • tab completion
  • double tab to list available options
  • execute all MI commands from Kamailio core and modules (module mi_rpc must be loaded)
  • execute RPC commands (core, tm and other modules)
  • over one hundred commands available from core and modules
  • change config variables during runtime (module cfg_rpc must be loaded)
  • option to format the output
  • connection to Kamailio via udp, tcp or unix sockets
  • help message for each command
For command line options, run: sercmd -h

Screenshots:
  • show available commands


  • list registered phones via MI


  • list TCP options via RPC



Next post to be about asynchronous tcp.

Friday, December 18, 2009

Best of New in Kamailio 3.0.0 - #4: cfg variables reload framework

Inherited from SIP Express Router (SER) via sip-router.org project, the cfg variables framework can be used by Kamailio 3.0.0 core and by the modules, to get and set internal variables on-the-fly, eliminating Kamailio restarts whenever it is possible. Such variables can be global or module parameters.

The operations with cfg variables can be done at any time without performance overhead. The framework makes sure that the variables do not change during the SIP message processing, the child processes see a snapshot of the variables with constant values. The variable that is changed will be automatically replaced by the framework the next time a SIP message is started to be processed.

The drivers can change the values of all the variables by names with or without the need of commit. That means a kind of transaction support, the framework can keep track of the changes (per driver) until they are committed or rolled-back.

New configuration values can be declared in the script, with following syntax :

group_name.var_name = value ['descr' description]

The values can be accessed via select calls:

@cfg_get.group_name.var_name

Example:

gateway.destination = "127.0.0.1" descr "IP addr of the gateway"
gateway.enabled = 1 descr "enable/disable the gateway"

route {
...
if (@cfg_get.gateway.enabled == 1) {
$du = "sip:"+ $sel(cfg_get.gateway.destination);
} else {
send_reply("404", "No gateway");
exit;
}


The cfg variables can be changed via control interface (e.g., xmlrpc) or using the new command line interface application (cli): sercmd.
sercmd cfg.set_now_int gateway enabled 0
Examples of what can be tuned via cfg variables framework:
  • tcp parameters (connect_timeout, send_timeout, connection_lifetime, asynchronous mode, keepalive, ...)
  • sctp parameters (autoclose, send_ttl, send_retries, ...)
  • dns parameters (dns_retr_time, dns_retr_no, ...)
  • other global parameters (debug, log_facility, memlog, force_rport, udp_mtu, ...) - see the cookbook for all tcp, sctp, dns and other global parameters
  • TM module parameters (fr_timer, fr_inv_timer, fr_inv_timer_next, auto_inv_100, auto_inv_100_reason, a.s.o.)
By using the cfg_db or cfg_rpc modules, values for those variables can be loaded from database or set via RPC control interface:

http://kamailio.org/docs/modules/3.0.x/modules/cfg_db.html
http://kamailio.org/docs/modules/3.0.x/modules/cfg_rpc.html

Next episode will be about sercmd.

Thursday, December 17, 2009

Best of New in Kamailio 3.0.0 - #3: route blocks with names

So far, the routing blocks defined in Kamailio (OpenSER) configuration file could get only integer IDs, for example:

route[10] {
$du = "sip:10.10.10.10";
t_relay();
exit;
}
That could make the big configs hard to understand after a while, when was need for troubleshooting or enhancements. It was a nightmare to check what route[24] was intended to do when you encountered the execution of it in another route.

In version 3.0.0, along with integer IDs, you can give string IDs to name the routes:

route[TO_ASTERISK] {
$du = "sip:10.10.10.10";
t_relay();
exit;
}
Previously, many people, including myself, used a text preprocessor like M4 to have string IDs for route names, but with some disadvantages: more files to manage (at least two m4 and one cfg), you had to edit all the time the m4 file, compile it with m4 in cfg, then the errors were reported by Kamailio relative to cfg file, resulting in mismatch of error's line number and the place you had to edit for fix.

However, the new embedded features with string names for routing blocks eliminates the restriction of up to 60 (40 in older versions) route blocks where the IDs must be in between 1 and 59. Instead of static array, the routing blocks are now in a hash table, allowing as many routing blocks as you need, with no constraints in naming.

Moreover, the string IDs can be used for any kind of routing block: route, failure_route, onreply_route, branch_route, ...

To call a route block, use the string name instead of integer ID:

route {
...
route(TO_ASTERISK);
...
}
The default configuration for Kamailio 3.0.0 uses this new feature: see it online .

Worth to mention that you can define now names for SIP message flags as well:

flags
FLAG_ACC : 1, # log in acc
FLAG_MISSED : 2; # log in missed_calls

...
route {
...
setflag(FLAG_ACC);
...
}
Next writing will be about new config parameters framework.

Wednesday, December 16, 2009

Best of New in Kamailio 3.0.0 - #2: define

The need of switching on or off features in Kamailio (OpenSER) 3.0.0 config file became more handy by addition of #!define directives support. There are five pre-processor directives:

#!define ID - define the ID
#!ifdef ID - test if ID is defined
#!ifndef ID - test if ID is not defined
#!else - create an else branch for ifdef/ifndef tests
#!endif - end an ifdef/ifndef block
Combining them, you can make parts of configuration file to be ignored at start time. For example, you can have in config a lot of xlog lines to help you troubleshooting, but you do not want them in a normal production environment. In your config you can have:

#!ifdef DEBUG_MODE
xlog("sip message from IP: $si and port $sp\r\n");
#!endif
To run in debug mode, add next line at the top of configuration file and then restart:

#!define DEBUG_MODE
For more examples, see Kamailio 3.0.0 default config file - authentication, NAT traversal, presence functionality, ... can be enabled or disabled via #!define.

Next to write about is route blocks with names.

Tuesday, December 15, 2009

Best of New in Kamailio 3.0.0 - #1: include file

I'm starting a series of posts, to highlight the best new features in Kamailio (OpenSER) 3.0.0, of course, from my point of view, hoping to cover most of them before full 3.0.0 is out (RC3 was done yesterday).

First one to write about is the include_file support. Over the time, with addition of new features, the config file got bigger and bigger. Being in consultancy business, I have hundreds of config files and deployments to maintain. In terms of structure, there are some parts repeating in most of configs, like:
  • sanity checks
  • authentication
  • nat traversal
  • presence handling, a.s.0.
Every time I did an improvement, I had to update in all configs. Now, using the include_file, maintenance is much easier. Practically, you can break down the config in many files and have the master config just including them. For example, split of sanity checks:

kamailio-sanity.cfg:

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if ( msg:len >= 8192 ) {
sl_send_reply("513", "Message too big");
exit;
}
if ( is_method("NOTIFY") && uri==myself
&& $hdr(Event) =~ "keep-alive" )
{
sl_send_reply("200", "OK - keepalive");
exit;
}

Now, at the top of main route block in each config, I include the 'kamailio-sanity.cfg' file:

kamailio.cfg:

...
route {
include_file "kamailio-sanity.cfg"
...
}
...
Note that you can use include_file anywhere in your config file - included file must contain valid config statements for the part where is included (e.g., global parameters, modules loading, module parameters, routing actions, etc.).

Next is going to be about #!define support, which completes perfectly the include_file feature to ease the maintenance, troubleshooting and development of config files.

Monday, December 14, 2009

Kamailio v3.0.0-RC3

Kamailio v3.0.0-RC3 is out - last release candidate before full 3.0.0 major version - the tarball with sources of Kamailio 3.0.0 RC3 is available at:

http://www.kamailio.org/pub/kamailio/3.0.0-rc3/src/kamailio-3.0.0-rc3_src.tar.gz

Kamailio Logo

Lot of fixes to packaging, code and documentation have been committed since RC1, Kamailio 3.0.0-RC3 becoming ready for pre-production phase.

If you like to work with source, then use the tutorial guiding the installation of Kamailio 3.0 branch from GIT repository:
http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.0.x-from-git

Two wiki pages were created to collect what is new in Kamailio 3.0 and how to migrate to this version:

http://www.kamailio.org/dokuwiki/doku.php/features:new-in-3.0.x

http://www.kamailio.org/dokuwiki/doku.php/install:1.5.x-to-3.0.0

Feel free to contribute to wiki pages, helping to build migration tutorials.

This is the last RC before full 3.0.0 relase. Please report any issue you find to sr-dev at lists.sip-router.org.

Wednesday, December 2, 2009

Daily tarballs for 3.0 branches

Thanks to Andrei, daily snapshots of sr_3.0, kamailio_3.0 and sr master branches can be downloaded from:

http://sip-router.org/tarballs/sr/

Note that new tarballs are generated only if there are changes for the corresponding branch (so if you don’t see a tarball with today’s date it means there was no change from the previous one).

The tarballs are generated via make tar, which makes sure the correct repository version will be included in the compiled binary (make tar generates first autover.h before creating the archive).

Monday, November 16, 2009

SIP Router Masterclass - Nov 2009, Berlin - remarks

The timing was perfect for this SIP Router Masterclass. In the first day, Berlin was celebrating the 20th anniversary of Wall fall, therefore the weekend before was full of public events.

Like every time, we had good distribution of students' origins, with people from Austria, Croatia, South Africa, France, Greece and of course Germany. The training room was delivered to us in German style, everything ready at the first hour Monday morning - computers for each student, network, projector, snacks and beverages - we being left to mount our SIP devices.

The evenings gave the opportunity to talk around German beers and sausages about the challenges SIP and VoIP face now, issues of the real world deployments and upcoming Kamailio 3.0 release.

Soon I should have some photos to upload.

Thursday, November 5, 2009

Kamailio Pronunciation

Looking at kamailio.org front page, I saw the links to Alison Smith's pronunciation of "Kamailio", which makes it sound nice and clear in English, although there are people saying it is not easy to do it.
Listening is believing:



Stay tunned for Kamailio 3.0.

Wednesday, November 4, 2009

Social Networking Event, Berlin, Nov 2009

Several folks working with Kamailio, SIP Router, SER, OpenIMSCore, SEMS and Asterisk are in Berlin next week, so we are going to have a dinner (or beer) meeting Thursday, 19:00, Nov 12, 2009. If happens that you are around and want to join, please send me (miconda [at] gmail.com) an email to make sure you get a seat. As usual for this kind of event, free participation with everyone paying for himself/herself.

Just to have an idea about how it could be, see some photos from previous similar events:

From private discussions so far, we should be already about 10 people, confirmed including myself, Olle E. Johansson (Asterisk) and Elena-Ramona Modroiu. There is a lot to celebrate, from integration work within SIP Router Project to upcoming Kamailio 3.0 (now RC1).

Tuesday, November 3, 2009

Vim syntax file for Kamailio 3.0


I updated the vim syntax file for Kamailio 3.0 and SR3.0/devel. There is now as well a script to auto-detect the type of .cfg file based on matching compatibility string (i.e., #!XYZ), loadmodule or main route line.
To install, copy the files in your home dir (see the hints inside each file to know which one to place where):


If you don't install the file type detect script, then you can use ":setf ser" once you opened the config file.

Friday, October 30, 2009

Kamailio v3.0.0-RC1

Kamailio v3.0.0-RC1 is out - first release candidate for a new major version ...

The tarball with sources of Kamailio 3.0.0 RC1 is available at:

http://www.kamailio.org/pub/kamailio/3.0.0-rc1/src/kamailio-3.0.0-rc1_src.tar.gz

Target of release candidate is to ease the usage and testing. It is a version with a huge set of new features and enhancements, the first one using the SIP Router core framework, thefore we focus on heavy testing.

There is also now a tutorial to guide the installation of Kamailio 3.0 branch from GIT repository:
http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.0.x-from-git

Two wiki pages were created to collect what is new in Kamailio 3.0 and how to migrate to this version:

http://www.kamailio.org/dokuwiki/doku.php/features:new-in-3.0.x

http://www.kamailio.org/dokuwiki/doku.php/install:1.5.x-to-3.0.0

Both documents still need a lot of care since many new features are missing or are not detailed, and definitely update guidelines do not cover all changes. Anyone can contribute and that is very much appreciated.

As we keep hunting and fixing issues, improve documentation, I hope to get to full release Kamailio 3.0.0 very soon. Enjoy RC1 meanwhile and report any issue you find to sr-dev at lists.sip-router.org.

Install Kamailio 3.0.0 from GIT

Just published a new a tutorial to guide the installation of Kamailio 3.0.0 from GIT repository:
http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.0.x-from-git

This is a wiki page, open for improvements to everybody.

Now it is the time of release candidate, with full 3.0.0 to be out soon, but the tutorial is going to be valid for all releases numbered 3.0.x

Thursday, October 22, 2009

Kamailio v1.5.3 Released

A new release in 1.5 series was published yesterday. Kamailio (OpenSER) 1.5.3 is based on the latest version of branch 1.5, including many fixes in code and documentation, therefore those running 1.5.0, 1.5.1 or 1.5.2 are advised to upgrade.

Source tarballs are available at:

http://www.kamailio.org/pub/kamailio/1.5.3/src/

Detailed changelog:

http://www.kamailio.org/pub/kamailio/1.5.3/ChangeLog

Download via SVN:

svn co https://openser.svn.sourceforge.net/svnroot/openser/branches/1.5 kamailio

Tag for this release can be browsed at:

http://openser.svn.sourceforge.net/viewvc/openser/tags/1.5.3/

Project site at SourceForge.net (still using old name):

http://sourceforge.net/projects/openser/

Binaries and packages will be uploaded at:

http://www.kamailio.org/pub/kamailio/1.5.3/

Modules' documentation:

http://www.kamailio.org/docs/modules/1.5.x/

What is new in 1.5.x release series is summarized in the announcement of v1.5.0:

http://www.kamailio.org/mos/view/Kamailio-OpenSER-v1.5.0-Release-Notes

Note: Kamailio is the new name of OpenSER project. First version under Kamailio name was 1.4.0. Older versions will continue to use OpenSER name. The source tree for current development version is hosted by SIP Router project, you can test it via:
http://sip-router.org/wiki/migration/kamailio-3.0-config

Next major release, Kamailio 3.0.0, with lot of new features and many improvements, is planned very soon, about the date of October 29, 2009.

Wednesday, October 21, 2009

Roadmap to Kamailio 3.0.0

I announced the plan to release Kamailio 3.0.0 next Wednesday or day after (October 28 or 29). With some delays, testing is going fine in my side, still some bits to be done, here is what I collected:
- taking in consideration $du updates in branch route
- import fixes from sr_3.0 branch
- complete core statistics and handling of drop reply

I believe is feasible, in the worse case we can package it at respective date and allow a bit more time for testing, but we unfreeze code and can go for new development. I encourage people to start writing migration documents.

Wednesday, October 7, 2009

SIP Router Development Meeting 2009 - Overview

The event was organized by FhG Fokus Institute, the place where was written first line of code for SIP Express Router (SER) and implicit of Kamailio (OpenSER).

Going through hot topics and discussions, we tried to solve current issues and to set the direction of development for next year.
Meeting Agenda

* Release of sip-router
* Short name selection
* Conflict resolution
* SEMS Advertisement
* Project Infrastructure

Participants
* Ancuta Onofrei
* Dragos Vingarzan
* Jan Janak
* Andrei Pelinescu-Onciul
* Bogdan Pintea
* Stefan Sayer
* Jesus Rodriguez
* Henning Westerholt
* Daniel-Constantin Mierla
* Grzegorz Stanislawski
* Ramona-Elena Modroiu
* Marcus Gotzl
* Markus Hunger
* Jiri Kuthan
* Christian Kaiser
* Bogdan Harjoc

Saturday, October 3, 2009

Podscast: Suzanne and I about Kamailio and Open Source VoIP

The day before SIP Router Devel Meeting in Berlin, I had very interesting Skype discussion with Suzanne Bowen about the VoIP environment today and Kamailio SIP Server project.

We could have talked for hours, Suzanne is the best at catching any new breed in IP communication world. Before ending we planed to record a short podcast (well, instead of 10min we got 14min) trying to look at best of past year:
  • releases and development
  • Best Open Source Networking Software 2009 award by InfoWord
  • sip router project
  • upcoming Kamailio 3.0
You can find the potcast at:

http://www.didx.net/podcast/?p=episode&name=2009-10-01_miconda_2009oct1.mp3

Should you be interested in learning how you can use Kamailio SIP server to build scalable and cost effective SIP/VoIP solutions, consider attending the Kamailio Masterclass, a professional training program taking place in Berlin, Germany, Nov 9-13, 2009, more details at:

http://www.asipto.com/index.php/sip-router-masterclass/

Thursday, October 1, 2009

Astricon 2009

Astricon 2009, the annual Asterisk conference, takes place in Glendale, AZ, October 13-15.

Saúl Ibarra has a talk "Asterisk, Instant Messaging and Presence: how?", touching the topic of integrating Asterisk and Kamailio (OpenSER) to get SIMPLE presence. A session that is worth to attend and discuss about with Saúl.

He is very active in IP communication and Kamailio world, with interests in SIP and virtualization, involved in SIPdoc.net project, developer of YASS and blogger.

Thursday, September 24, 2009

What is wrong with VoIP word?

Travels, talks and telephony! There is "a thing" thrown from a corner to the other, enabling fear for some, hope for others. That is VoIP and clear is misused.

Bloggers around the world chopped every news about VoIP providers failure -- let's not give names, searching web will reveal important Telcos or famous venture-capitalist backed up operators closing their VoIP offerings.

Therefore something is wrong, what the heck? Everywhere I get the technology is heavy used. But hated in the same time. In my opinion it started with the way VoIP was brought to the market, since everybody contributed to it and mixed the technology with the service, building FUD, thus confusing environment.

Simply and in first place, VoIP is a telephony technology, on the same layer as TDM, ISDN. Not a service. The operator must not go to enterprise and end user selling VoIP, they must keep selling telephony plus new services. Digital telephony came as added value against analog telephony by allowing dynamic interaction via DTMF and more features to PBX-es. That was one of the attractions that made it worth to deploy and successful.

Today the operators simply fail to present the advantages VoIP brings to customers. In addition, Telco and Mobile operators perform anti-promoting actions to VoIP and they rely on it more than others for backbones and even to end customers -- just that they say it is either IMS based service or what so ever NGN-service.

Therefore I think everyone should review how they show VoIP. If I would be Telco or Mobile operator I would stop saying VoIP provides no QoS, is insecure, a.s.o. Simply that harms them, and I do it with every occasion asking what is what they use to route international calls, what is their new service based on, ...

So, they admit doing VoIP, but on private, secure network. Here we are! What they should better say? Telephony services on VoIP over public network cannot ensure YOU, the end user, QoS, security (well, here lot to debate, but not the scope of this post) and everything else they consider being atu of doing VoIP over their walled-garden infrastructure.

Pure VoIP service providers did the big mistake of advertising VoIP as service, and even worse, free service, thus they cut the main revenue stream, trapping themselves in traffic generation for termination, strongly tied to Telcos, rather than new services business. While a I see it "free as in speech" and not "free as in bear". The freedom I see is I, the customer, have the liberty to choose my terminal and use what ever functionality I like from what VoIP enables.

Everyone should promote what VoIP enables YOU, the customer, to access hell-out of many new services, like presence, instant messaging, video, integration with social networking sites, mobility, multiple identities on the same wire, a.s.o.

First, the average guy does not care what is VoIP. He needs to communicate and businesses should focus on that demand. Look at car manufacture, nobody promotes the technology behind new models, but the better fuel consumption figures, speed and acceleration, a.s.o. -- exactly what the end user cares about.

I, on the other hand, go to operators and sell VoIP solutions. And say, hey, VoIP is the technology to build the future of telephony, showing benefits of new services, maintenance costs, etc. I must promote the technology and scream in all direction VoIP, VoIP, VoIP.

Wednesday, September 23, 2009

Kamailio - amazing autumn

It is very encouraging that the businesses around the project are growing and development speeds up. In the last days there were two requests for Kamailio specialists, so, if you are one of them and willing to work in Germany or Austria, within dynamic teams in challenging markets, check these posts were I summarize the announcements from Kamailio mailing lists.

- jobs at 1&1 Germany

- jobs at Sipwise Austria

Autumn moves forward with couple of events related to the project where you can meet people engaged in the project and learn how you can use Kamailio for various IP communication services:

- VoIP2Day, Madrid, Spain, Sep 24-25, 2009

- SIP and IMS for Next Generation Telecoms Forum 2009

- SIP Router Devel Meeting, Berlin, Germany, Oct 2, 2009

- Astricon 2009, Arizona, USA, Oct 13-15, 2009

- Training - Kamailio SIP Masterclass, Berlin, Germany, Nov 9-13, 2009

All these together with planned release of Kamailio 3.0 in October and further developement of SIP Router core framework announce an amazing autumn ahead.

Monday, September 21, 2009

SIP and IMS for Next Generation Telecoms 2009

On short notice, I will present Understanding SIP/VoIP Architecture Design at SIP and IMS for Next Generation Telecoms 2009, September 23-25, Berlin, Germany.

The presentation is held on Sep 23, 11:30, focusing on:

  • Optimising next generation SIP networks
  • Planning and implementing new SIP functionalities
  • Using SIP for prepaid systems and internet telephony platforms
  • Integrating load balancing and session border control
If you are in Berlin during the event and want to meet, send me an email at miconda [at] gmail.com .

Wednesday, September 16, 2009

Book: SIP Security

I had it from quite some time now, really enjoyed reading it, so time for blogging it.


First, all authors are former fellows at FhG Fokus Institute, Berlin, Germany and most of them tight involved in SIP Express Router from day one. So this is not something written upon theoretical research and concepts but upon years of hands on experience with SIP networks.

Having technical background, I found interesting the blending of cryptographic mechanisms, security concepts and applicability to SIP networks. Everything needed to fully understand the book is inside.

For me, it is important to mention that lot of scenarios and solutions are exemplified with SIP Express Router, project I was involved pretty much from its beginning, from where I started Kamailio (OpenSER) back in 2005 and I met again last November within SIP Router project.

The foreworld from Philip Zimmermann really synthesize the security concerns about VoIP and SIP. Shortly, the main chapters:
- introduction to cryptographic mechanisms
- introduction to SIP
- introduction to IMS
- secure access and interworking in IMS
- user identity in SIP
- media security
- denial of services attacks on VoIP and IMS service
- spam over IP telephony

The chapter about DoS attacks is comprehensive, covering over 15 type of attacks. I will blog in more details about the chapters I find most interesting for me.

The book is available on Amazon UK:
http://www.amazon.co.uk/gp/product/0470516364/

There you can see complete table of content. A dedicated site for SIP security and this book is put up together by authors at:
http://www.sipsecurity.org/

Tuesday, September 15, 2009

Kamailio Jobs at Sipwise, Vienna, Austria

Sipwise is currently hiring a VoIP System Administrator for an interesting position based in Vienna, Austria.

You have strong skills in Linux system administration (Monitoring and Alerting using SNMP/Nagios/Cacti/MRTG, Scripting in Perl/M4/sh), a deep understanding of highly available system deployments and good knowledge regarding SIP (preferably Kamailio, Sems, Asterisk)?

Sipwise offer you a challenging position to help our team further improving our Kamailio-based Class5 Softswitches, deploying them at customer sites and supporting our customers (large DSL and Cable Providers throughout Europe) and sales teams with technical details.

If you are interested, please send email to Andreas Granig, agranig [at] sipwise.com

Monday, September 14, 2009

SIP Router Development Meeting 2009

Next SIP Router Project Development Meeting coordinates:

Date: Friday, October 2, 2009

Place: Berlin, Germany

The event is co-hosted by FhG Fokus Institute and Technical University Berlin at following address:

FhG Fokus, Room 1008
Kaiserin-Augusta-Allee 31
10589 Berlin
- see venue of the location


Among the goals of the meeting:

  • analyze the development and progress so far
    • Kamailio (OpenSER) and SER integration is 99% completed
    • first major release based on SIP router – Kamailio 3.0 – is due in one month – during October
    • OpenIMSCore extensions ready to use with SIP router core
    • what was good and bad?
  • find solutions for conflicting modules and namings
    • database table structures
    • database table names
    • module names
  • future directions
    • versioning and releasing policies
    • targets for next year
  • organizational aspects
    • infrastructure
    • management
  • social networking and business environment

The participation is free of charge for anybody upon registration via short email at:

registration [at] lists.sip-router.org

this being required for proper dimensioning of meeting room and needed logistics. Registration must be done before September 28, 2009.

Who you can meet there:

Who should consider participation:

  • people willing to get a close feeling about project development
  • people willing to understand how and when SIP Router can be used
  • people willing to meet face to face with the others acting within SIP Router project environment

Agenda:

  • developer slot: presentations from developers
  • community slot: presentations from community and business representatives
  • open discussions
  • social networking event

Hacking day:

  • if there is interest from developers, the days before the public meeting can be organized as hacking session, where you get your hands dirty and code around the project. Do not forget to mention your interest in such event!

You can address general questions about the event via email to:

sr-dev@lists.sip-router.org

More details to follow soon! Stay tuned!

Friday, September 11, 2009

SIP Router: Number Portability Functionality

Courtesy of Henning Westerholt, SIP Router repository includes dedicated module and applications for fast number portability handling - hte feature will be part of upcoming Kamailio (OpenSER) 3.0 release.

pdb server

This server loads serialized routing data from the disk and stores it in memory. It then listens on an UDP port for requests containing a number and returns ID of the carrier which owns the number. This server uses the same data structure as the carrierroute module and provides a really good performance — consumes only a few percent CPU, even you use only one server for your complete call routing cluster.

pdb connector module

This module connects the sip-router server to the pdb server. It supports load-balancing and aggressive timeouts. Normally it does not need more than a few ms to query the remote server and return the reply to the configuration script.

pdb tool (data compiler)

This tool provides the functionality to compile the carrier and number information into the binary data format the pdb server expect. It supports optimizing the generated trie structure, so that for example the complete number to carrier mapping for Germany (app. 150 million numbers) don’t need more than a few hundred megabytes. You can also combine not interesting carriers in order to save even more space and get better performance.

The module can be in the modules/pdb directory, the server and tool is in utils/pdbt. This directory also contains documentation (README for module, utils/pdbt/docs/* for data format and network protocol).

Thursday, September 10, 2009

SIP Router: Apply Changes to SIP Message in Config File

One of the most discussed architectural aspects of configuration file was the way changes done to received SIP messages are handled – even new headers are added, old are removed or different parts of message were updated, the changes were not immediately visibile.

The latest GIT repository includes a new config function – msg_apply_changes() – exported by module textops from modules_k folder. Once this function is used, all changes done up to that point are applied and further processing within config will see the new message content.

The new function can be used only in request route for now. Be carefully when using it, since it changes the expectation you had so far of always working on initially received SIP message. Once the function is used, initial content is lost forever. As it builds a new buffer and re-parses, it is not very recommended to use it extensively.

Example of usage:

append_hf(”My-Header: yes\r\n”);
if(msg_apply_changes())
{
# msg buffer has a new content
if(is_present_hf(”My-Header”))
{
# will get always here
}
}

Readme of the module:

http://sip-router.org/docbook/sip-router/branch/master/modules_k/textops/textops.html

The functionality will be part of upcoming Kamailio (OpenSER) 3.0 release.

Wednesday, September 9, 2009

Freezing for Kamailio 3.0

Time for first release based on SIP Router Project is approaching. Source code will be frozen Monday, September 14, 2009, to enter the testing phase for releasing Kamailio 3.0.

As usual, work on additional tools and documentation can go on during testing. Developers willing to push brand new features in the next major release have to hurry.

A draft of new features is compiled at:

http://sip-router.org/wiki/features/new-in-devel

For a complete picture of what Kamailio 3.0 will bring new comparing with 1.5 you have to check inherited features from SIP Express Router as well:

http://sip-router.org/benefits/

Friday, September 4, 2009

Support for ‘include’ in config file

The configuration file language of Kamailio (OpenSER) and SIP Router supports now a new directive that allow including the content of another file during parsing of routing logic.

This allows splitting big configs for easier maintenance, even modularity — building a library of config snippets that are included and combined to build a full configuration file.

The syntax is:

include_file “file_name”

There is no restriction of what the included file should contain, it must be a valid content for the place where the include directive is used.

Here is an example:

route {
...
include_file "/sr/checks.cfg"
...
}

--- /sr/checks.cfg ---

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

---

The feature is documented at:

http://sip-router.org/wiki/cookbooks/core-cookbook/devel

Thursday, September 3, 2009

Kamailio Jobs at 1&1, Karsruhe, Germany

Interested in working with one of the biggest Voice over IP networks in Europe? 1&1 is hiring and have two open positions in Karlsruhe, Germany.

For more information (requirements, how to apply..) please refer to the openings on comapny's job page (German). Some facts about our VoIP system can be found at:

http://www.kamailio.org/events/2009-linuxtag/presentation.pdf

Shortly:
  • over 2 million subscribers
  • over 1 billion minutes per month
  • over 50 servers SIP platform

Please feel free to contact Henning Westerholt ( henning.westerholt [at] 1und1.de ) for any question.

Info about positions:

Tuesday, September 1, 2009

Kamailio Awarded Best of Open Source Software 2009

InfoWorld has published the Best of Open Source Software Awards 2009. Kamailio (OpenSER) has been awarded within category: Best of Open Source Networking Software.

From InfoWorld site:

"Award winners in network and network management are old favorites Cacti and Nagios, the IPCop firewall, Kamailio SIP proxy server, KeePass password manager, Openfiler SAN/NAS appliance, OpenNMS enterprise monitoring system, PacketFence network access control solution, Puppet configuration management framework, and Untangle network security gateway."

"Kamailio is the open source SIP proxy server formerly known as OpenSER. Used with an Asterisk IP PBX server for phone features, plus a hardware gateway for connection to the outside world, Kamailio brings important call handling and scalability benefits to Asterisk, while also removing the Asterisk server as a single point of failure. Larger organizations get the phone features they need, as well as the added safety of VoIP calls surviving an Asterisk server outage."




Here it is...

On the other hand, Kamailio project is approaching the time for a new major release -- a matter of days to enter the testing phase -- this one will be versioned Kamailio 3.0 to reflect the major enhancements, among them: the http://sip-router.org core, asynchronous TCP, asynchronous SIP message processing API, memcached backend, native topology hiding, nat traversal using kernel space for media relaying ... see more at:

http://sip-router.org/benefits/

http://sip-router.org/wiki/features/new-in-devel

The news on project's website:
http://www.kamailio.org/mos/view/News/NewsItem/Best-of-Open-Source-Software-Awards-2009/

Monday, August 17, 2009

QjSimple - Portable SIP softphone

I was looking to find a SIP softphone that is portable - targeting Windows, Linux and MacOSX. One of the most important features: handy for developers playing with SIP and VoIP.

So far, I worked mainly on Linux and there the old (obsoleted?!?!) KPhone did (still does) a great job. There are other free softphones, Twinkle is one of the best, but I needed something for MacOSX.

Few weeks ago I checked QjSimple, a project led by Klaus Darilion (which is also developer and management board member of Kamailio SIP Server). It uses pjsip library and has QT interface, porting was piece of cake - just some Makefile update.

Now, version 0.6.3 is offcially available for Windows, Linux and Mac OS X.

Friday, August 14, 2009

SIP Router Project - GIT, Wiki and Bug Tracker

I have played a bit with dokuwiki and developed two plugins for it that allow quick referencing with GIT and FlySpray:

FlySpray is a lightweight bug tracking system that uses dokuwiki syntax, therefore any syntax plugin for dokuwiki should work out of the box for it as well.

Applied to SIP Router project, that means:

For FlySpray, when one describes or comments a bug, he/she can reference to a git commit by using: GIT#hash

- hash must be at list the first six characters of git commit hash value

Unfortunately FlySpray accepts only plain text in the "Close Task" description, so the GIT reference does not work there, yet.

In dokuwiki same syntax can be used. In addition, one can add references to FlySpray items via: FlySpray#itemid

- itemid is the integer id of FlySpray tracked item

I tried to collect all these plus other options for DW syntax in a wiki page:
http://sip-router.org/wiki/tutorials/contribute-to-dokuwiki

Saturday, August 1, 2009

VirtuaBox 3.0 and Mac OS X

I am quite impressed by the last release of VirtualBox, the 3.0.x, it runs fast using low resources. Having Ubuntu 9.04 as guest on Mac OS X goes smooth, the auto-detected focus makes usage of keyboard and mouse straightforward.

The only problem I encountered is using bridged network mode with airport. I get IP address via dhcp, setting for dns, but the gateway is not reachable. The other computers in the network are visible via IP, but access to internet doesn't work.

I need this mode so other nodes can connect to guest OS on my laptop -- here falls the SIP phones I used to test the development of Kamailio (OpenSER) and SIP-Router.org. Internet access is nice to have although I can do it from the host OS, having it on guest OS makes everything move faster.

The solution I found is to add a second virtual network card to guest OS which is set in NAT, and voila! internet access. Nice!


Don't forget to install guest additions, they are marvelous for Ubuntu 9.04 - full screen in the way you barely notice you haven't booted directly Ubuntu.

Thursday, July 30, 2009

MacBookPro - low budget keyboard - vim and mc

I realized that the very hyper glamorized MacBookPro (and probably the other variants) was designed against portability, developers and system administrators.

While every application (ahh, before getting in to this apple stuff) built its navigation system having in mind few "standard" keys, most of them are missing on MacBookPro keyboard: Page Up, Page Down, Home, End (Insert, Delete, ...). There is no indication on the keyboard what combination of keys to press to get them.



Of course, because it is not something standard, you have to remember for each application the combination or try blindly CMD, SHIFT, CTRL, ALT plus UP, DOWN, LEFT or RIGHT (BACKSPACE). If you are lucky you may get it. If you are "very lucky" you may screw up what you do because the combination you just tried does something else.

Considering opening an account to make donations for future versions to overcome this...

Google did its job this time as well. Here are some hints for guys doing remote administration via terminal.

Midnight Commander - nightmare commander without INSERT key - you are saved by CTRL+t.

I nice guide to start with Midnight Commander can be found here. Default hotkeys bindings can be found on project's web site.

Vim is classic and designed to be terminal independent, therefore has lot of direct keyboard shortcuts
  • type 'i' to get in insert mode
  • '$' and '^' to jump to start of line end of line in command mode
See here a comprehensive list of vim tips.

Also take in consideration a 5 bucks usb keyboard - can save you some nerves (and the macbook) during migration time.

Monday, July 27, 2009

SIREMIS v0.9.3 Released

A new version of SIREMIS Web Management Interface for Kamailio (OpenSER) and SIP-Router.org is available as v0.9.3. Among new features:
  • communication with SIP-Router.org and SIP Express Router (SER) via XMLRPC (RPC command interface)
    • pear package XML_RPC must be installed
  • communication with FreeSwitch via event socket
    • no extra library required, implemented as library using TCP sockets
  • support to print rich html formatting of MI, XMLRPC and FreeSwitch command response (config option)
    • makes use of rich text editor features, output can be formated using the HTML languages (previous version displayed the output as text plain in a textarea)
  • stand-alone PHP classes for MI, XMLRPC and FS Event Socket, making further development easier
    • the code for communication with SIP applications is now separate of the view php code
    • php classes can be easy pulled and used in other PHP applications
  • output of commands can be filtered for nicer display (e.g, see FS help, xmlrpc MI commands)
    • current architecture makes easier to highlight parts of the command output, now just couple of commands benefit of pretty formating, the others print raw format (e.g., xmlrpc response)
  • MI, XMLRPC and FS Event Socket groupped under Cmds Panel tab
    • dedicated tab for external commands
  • updated phpopenbiz core
  • fix for re groups db table
  • link referencing on username between group view, db aliases view and subscriber view
    • click on an username value jumps to subscriber view matching that user
  • more options to sort the views using column names
    • more column names become clickable to sort the records
  • auto-suggestion for group name when adding a new record
    • auto-completion as you type the group name

Siremis Project homepage:

http://siremis.asipto.com

Download and installation steps:

http://siremis.asipto.com/install/

View screenshots:

http://www.asipto.com/gallery/v/siremis/

Demo site (it works on a database with random data, username: admin, password: admin):

http://siremis.asipto.com/demo/

Saturday, July 25, 2009

New look for Siremis web page

The Siremis Project web site just got a new look in preparation for a new release.

Aiming to build a flexible and handy to use web management interface for Kamailio (OpenSER) and Extensible SIP Routing Platform, Siremis approaches the 3rd public release since launch during winter this year.

Siremis is the base of all management interfaces provided with Asipto's VoIP solutions, such as internet telephony platform, sip prepaid system, load balancing and traffic dispatching.

Wednesday, July 22, 2009

SIP Router Bootcamp, Berlin, Germany, Sep 1-4, 2009

Next SIP Router Bootcamp will take place at the end of the summer, on September 1-4, 2009 in Berlin, Germany.

Teachers:

Daniel-Constantin Mierla - co-founder of OpenSER/Kamailio project in 2005, currently core-developer and member of project’s management board

Olle Johansson - Asterisk developer and member of the Digium Asterisk Advisory Board.

By end of 2008, Kamailio (OpenSER) and SIP Express Router (SER) started a joint collaboration under http://sip-router.org project, bringing together valuable developers and architects of SIP servers. Kamailio 3.0 and SER 3.0 (to be released soon) become compatible in terms of configuration file and extensions.

Learning to configure the SIP server is not easy, but is the key for a successful and secure VoIP business. The flexibility of SIP routing engine allows you to implement in no time innovative services, IP telephony, Instant Messaging, Presence and beyond. Asterisk comes to complete with rich media services and applications. Doing everything designed right and scalable saves time and money.

We create the opportunity for you, guided by experienced instructors, to learn how to build an Unified Communication platform from scratch using the SIP server engine and Asterisk.

Click here for course details and registration.

KeePassX, Mac OS X and Auto-typing

March 31, 2015: an updated version is now available, see the article at:

Being long time Linux user and doing lot of remote consultancy (you know, VoIP solutions design and implementation using Kamailio and SIP Router), one of the most used application was KeePassX. It fits perfectly for secure storing of my long list of usernames, passwords, IP addresses and web URLs.

Recently I become the owner of a MacBook Pro and fortunately KeePassX is available (natively) for Mac OS X, but with no auto-typing. That is very handy in Linux for authentication on web pages. I tried to play a bit with KeePass (the original Windows version) and Mono, but the results were not very satisfactory (quite tight tied to Windows style), plus that I could not import the KeePassX database (I would need a Windows box).

Checking the web for KeePassX and auto-typing revealed clearly that is not available for Mac OS X out of the box, but folks around gave some good hints, so I started digging in. Pretty soon a plan was sketched:
- AppleScript give the tools for a nicely and easily coding of interactive applications
- KeePassX uses OS URL handlers to start applications when double-clicking the URL field of stored records
- MoreInternet application for Mac OS X offers easy way to manage URL helper applications

Therefore, here we are...

Step 1
Go, download and install MoreInternet:
http://www.monkeyfood.com/software/MoreInternet/

We will be back later to its configuration.

Step 2
Create the application handler for a new URL type. Open the Script Editor and paste following code:
on open location localURL
-- kex://proto?username:password:address:port/path

set thePath to text 7 thru -1 of localURL
if (text 1 thru 4 of thePath) is "ssh?" then
-- ssh?
set theProto to "ssh"
set theData to text 5 thru -1 of thePath
else
if (text 1 thru 6 of thePath) is "https?" then
 -- https?
 set theProto to "https"
 set theData to text 7 thru -1 of thePath
else
 if (text 1 thru 5 of thePath) is "http?" then
  -- http?
  set theProto to "http"
  set theData to text 6 thru -1 of thePath
 else
  -- assume http
  set theProto to "http"
  set theData to thePath
 end if
end if
end if

set theCLPos to offset of ":" in theData
if theCLPos = 0 then
display dialog "INVALID URL - NO USER"
return
end if
set theUser to text 1 thru (theCLPos - 1) of theData
set theData1 to text (theCLPos + 1) thru -1 of theData
set theData to theData1
set theCLPos to offset of ":" in theData
if theCLPos = 0 then
display dialog "INVALID URL - NO PASSWORD"
return
end if

set thePass to text 1 thru (theCLPos - 1) of theData
set theAddr to text (theCLPos + 1) thru -1 of theData

-- display dialog "URL+: " & theProto & "://" & theUser & ":xyz@" & theAddr

if theProto is "ssh" then
tell application "Terminal"
 activate
 delay 1
 set theCLPos to offset of ":" in theAddr
 if theCLPos = 0 then
  set theSSHUrl to "ssh " & theUser & "@" & theAddr
 else
  set theHost to texts 1 thru (theCLPos - 1) of theAddr
  set thePort to texts (theCLPos + 1) thru -1 of theAddr
  set theSSHUrl to "ssh -p " & thePort & " " & theUser & "@" & theHost
 end if
 do script with command theSSHUrl
 set theButton to button returned of (display dialog "Auto type? (" & theAddr & ")" buttons {"No", "Yes"} default button "Yes")
 if theButton is "Yes" then
  tell application "System Events"
   keystroke thePass
   key code 52
  end tell
 end if
end tell
else
set theHTTPUrl to theProto & "://" & theAddr
tell application "Safari"
 activate
 delay 1
 tell window 1 of application "Safari" to make new tab
 tell front window of application "Safari" to set current tab to last tab
 set the URL of document 1 to theHTTPUrl
 set theButton to button returned of (display dialog "Auto type? (" & theAddr & ")" buttons {"No", "Yes"} default button "Yes")
 if theButton is "Yes" then
  tell application "System Events"
   keystroke theUser
   keystroke " "
   keystroke thePass
   key code 52
  end tell
 end if
end tell
end if

end open location

Save it as Application Bundle, say under 'kpx' name.

Step 3
Update Application bundle meta-data

Edit kpx.app/Contents/PkgInfo and set the content to "APPLokpx" (no double quotes). Edit kpx.app/Contents/Info.plist and set the bundle signature to the last 4 letters of the value in PkgInfo file and add details about 'kpx' URL handling, you should get to something like this:
<key>CFBundleSignature</key>
<string>okpx</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
 <key>CFBundleURLName</key>
 <string>KeePassX</string>
 <key>CFBundleURLSchemes</key>
 <array>
  <string>kpx</string>
 </array>
</dict>
</array>

Note: CFBundleSignature should be there already, just update the string value. CFBundleURLTypes (and the array value) must be added.

Step 4
Set the 'kpx' URL helper application.

Open System Preferences, then More Internet and add a new protocol 'kpx'. Associate the kpx.app (the application bundle built above) with this URL type. Now, all URL starting with 'kpx://' should be opened with kpx application.

Step 5
Add entries to the KeePassX

The format of the kpx URL is kind of special to fit my needs of opening http and ssh URLs:

kpx://proto?username:password:address:port/path

- proto can be http, https or ssh - if it is something else, it assumes http (can be extended or just use the given value and let the OS handle it)
- the rest are more or less self explaining, 'path' is just for HTTP(S) - the part after server address in web URLs

Here are some examples:

kpx://ssh?{USERNAME}:{PASSWORD}:192.168.64.103:14092
kpx://http?test:testpw:192.168.64.103/admin/login.php

As you can see, it is possible to use the KeePassX self expanding variables such as {USERNAME} or {PASSWORD}.

The format is chosen this way to be compliant with URL specs, you can try a different one, which might be nicer from your point of view, but you have to adjust kxp.app accordingly.

Step 6
Save the KeePassX record and double-click on URL field.

The Terminal or Safari should start depending whether is SSH or HTTP/S URL. A dialog prompting if you want auto-type pops up. Wait (this is important) until SSH prompts for password or the web page is completely loaded. Then you can click "Yes". If you don't want auto-type, press "No".

REMARKS:
  • do not use real username and passwords until you are sure the kpx application handler starts correctly. If the OS didn't register the URL helper properly, Safari will open and try to guess what site you want to open, so it may result in trying accessing public web sites with your username and password in URL (e.g., kpx.com/username/password/address) which will stay in remote server logs
  • you can change the 'kpx' to anything you want, which is recommended anyway. You have to do small adjustment for the parser in kpx.app to skip it, update the metadata URL types and the System Preferences, Internet More records.
  • it is my first Apple Script coding, so bare with me if there are other nicer ways to accomplish same goals
  • yeah, you get auto-type for SSH which is not possible in Linux

Hopefully I haven't forgotten anything important. I did it about one week ago. I hope some of you will enjoy and contribute back with improvements or comments (which are moderated by the way). Maybe KeePassX will add auto-type feature for Mac OS X soon, that would be great. Being myself an open source developer, I have to congrat the KeePassX coders, a great project.

Some screenshots:


Tuesday, July 21, 2009

Blog by MiConDa

I started this new blog by importing the stories of one of my active blogs:
http://openser.blogspot.com

The plan is to unify my blogs here, therefore shortly I will import entries from:
http://miconda.wordpress.com

OpenSER blog is no longer appropriate as the project changed the name in Kamailio, last year, July 28. More over, development of the SIP server project is hosted by sip-router.org , making possible to run Kamailio (OpenSER) and SIP Express Router (SER) extensions on the same SIP server instance. Kamailio 3.0 (planned for late September this year) will be a boost in performances and features.

The other blog hosted by wordpress.com was kind of mirror for most important news about the SIP server projects and stories about project environment, linux and life. Not much active and pretty unsync'ed. So I decided to unite them.

Why "by-miconda"? Well, miconda is taken (not active though) on blogger.com, but is the nickname I used so far. Blogger offers the export blog functionality, thus I could import entries from OpenSER blog in a minute. Importing them in wordpress.com would have taken ages. On the other hand, the stories to be imported from wordpress.com are few and can be done with copy&paste.

blogger.com offers option to rename the blog, but openser.blogspot.com worth to stay around a while.

These being said, expect here:

Thursday, July 16, 2009

Roadmap to Kamailio (OpenSER) 3.0

The roadmap to next major release of Kamailio (OpenSER), codenamed 3.0, was sketched during IRC meeting Jul 07, 2009, as:

- freezing in 1-1.5 months

- 1-1.5 months testing

- release by end of September/ beginning of October

Right now, current development state is:

- all but one module (seas) were updated to work with the new core

- several addons in kamailio core and tm still to be included in GIT master branch

- many new features developed: mecached, event_route, xml doc handling … see:

http://sip-router.org/wiki/features/new-in-devel

All of you are invites to test, startup guidelines can be found at:

http://sip-router.org/wiki/migration/kamailio-3.0-config

You can send feedback at: [sr-dev (at) lists.sip-router.org]

Wednesday, July 15, 2009

Kamailio (OpenSER) v1.5.2 Released

A new release in 1.5 series is out. Kamailio (OpenSER) 1.5.2 is based on the latest version of branch 1.5, including many fixes in code and documentation, therefore those running 1.5.0 or 1.5.1 are advised to upgrade.

Source tarballs are available at:

http://www.kamailio.org/pub/kamailio/1.5.2/src/

Detailed changelog:

http://www.kamailio.org/pub/kamailio/1.5.2/ChangeLog

Download via SVN:

svn co https://openser.svn.sourceforge.net/svnroot/openser/branches/1.5 kamailio

Tag for this release can be browsed at:

http://openser.svn.sourceforge.net/viewvc/openser/tags/1.5.2/

Project site at SourceForge.net (still using old name):

http://sourceforge.net/projects/openser/

Binaries and packages will be uploaded at:

http://www.kamailio.org/pub/kamailio/1.5.2/

Modules' documentation:

http://www.kamailio.org/docs/modules/1.5.x/

What is new in 1.5.x release series is summarized in the announcement of v1.5.0:

http://www.kamailio.org/mos/view/Kamailio-OpenSER-v1.5.0-Release-Notes

Note: Kamailio is the new name of OpenSER project. First version under Kamailio name was 1.4.0. Older versions will continue to use OpenSER name. The source tree for current development version is hosted by SIP Router project, you can test it via:
http://sip-router.org/wiki/migration/kamailio-3.0-config