Kamailio Advanced Training
Click here for more details!

Learn how to build RTC services with Kamailio!

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

Tuesday, July 14, 2009

New module MI_RPC available

Several days ago, a new module named mi_rpc was added to the source tree. The goal is to be able to execute MI commands using RPC interface from sip router core.

One big advantage of this is executing MI commands using the sercmd tool. sercmd is a command line interface, able to do auto completion for commands, used to change parameters, get insights of core and modules at runtime.

If you grabbed the source code (some guidelines at: http://sip-router.org/wiki/migration/kamailio-3.0-config ), then:

cd utils/sercmd

make

./sercmd

At the prompt: “mi ps”

See the readme of the module for more options:

http://sip-router.org/docbook/sip-router/branch/master/modules/mi_rpc/mi_rpc.html

You need to compile and load modules_s/ctl:

http://sip-router.org/docbook/sip-router/branch/master/modules_s/ctl/ctl.html

Saturday, July 11, 2009

Two more modules updated

Two of the last three modules that were not ported to use the new sip router core are ready now: nat_traversal and siptrace.

Particularly, siptrace was refurbished a lot. Before release, there are couple of new features that should get in trunk since sip route core offers support for such extensions:

- ability to filter the ACK for negative replies issued by sl module in the script

- ability to store stateless forwarded messages (now only stateful ones being stored)

Testing is very much appreciated, see guidelines at Kamailio 3.0 Config wiki page.