Apologies if any of the questions below are a bit dumb - I don't pretend to be an expert in SIP/VOIP - I am just an ordinary user looking for answers.
Our current setup involves processing a small number of internal sip accounts (up to 10, no more than that) and one "public" one (with a separate registrar) in the following way:
On our server we have three interfaces: eth0, eth1 and tun0. eth0 is our entry point to the public internet, eth1 faces our internal network and tun0 is a private vpn, which connects all our smartphones to the internal network (via Wifi, EDGE/2G/3G etc). This gives us the mobility.
Up until now, we have been routing voip calls via a commercial (closed source), very limited, terribly outdated (Pentium code base!) and rather buggy sip proxy. I had to employ a lot of hacks on our server in order to route calls as this proxy can only listen on a single interface. It was also a nightmare to maintain. Unsurprisingly, I decided that enough is enough and I am now determined to replace it.
We route calls in the following way: all machines (PCs are all Linux based) & smartphones have their own sip/voip client installed on them (also using bluetooth). Internal calls are routed via the proxy between ourselves either on the internal net (eth1), or between the vpn and eth1 (eth1<->tun0).
External calls (going out, i.e. outbound) are routed externally to our registrar, using a single separate voip account, via eth1<->eth0 or tun0<->eth0.
As I am now looking to replace our proxy, I looked at Kamailio, but was soon completely overwhelmed by it (no offence intended, it was just too much to take at first). I would appreciate if any of you could give me a hand, or at least point me in the right direction, with the following issues:
I presume I could configure Kamailio to listen on more than one interface and act as a proxy. How do I do that, so that it listens on all 3 interfaces and proxies requests in the following way: - calls made to <userX>@ourdomain.net to be routed internally via eth1 (internal net) or tun0 (private vpn); - calls made to anybody else to be routed externally via eth0 (public) using the separate "public" sip account with our external registrar; - calls made to the public sip account (from outside - the "public") need to be routed to a "nominated" internall account (say <user0>@ourdomain.net); - all other (internal) calls need to be routed depending on which interface this account has been registered/logged in - either the internal net (eth1) or the private vpn (tun0 - the smartphones).
Obviously, calls need to be received (and routed properly) from all 3 interfaces.
Is all of this possible with Kamailio?
I want to avoid unnecessary complexities of the setup (as I already mentioned above - I am just a user and by no means an expert in sip/voip) and do not want to deploy something I do not need - I need to keep the memory footprint to a bare minimum, possibly without sacrificing performance.
Once this is done, I would then move on to the next phase and use IM & ENUM, but this is once the above works.
I looked at other alternatives, but I got very confused there as well - I couldn't figure out what exactly is the difference between, say, OpenSER, Kamailio, OpenSIPS and SIP-Router even? What is the best software to use in order to achieve the above setup?
One last thing - I am a developer by trade and I am not afraid of "tweaking" things when needed. I was successful in compiling Kamailio from source (I use Fedora on all our machines) and I was pleased that I could exclude from the RPM .spec file the modules I think I did not need.
I also made some modification of my own to make the database modules (mysql, postgresql and unixodbc) configurable in the same way the rest of the modules are. I could submit patches, if needed, so that these are incorporated into future releases - how do I do that?
I could not do the same with OpenSIPS, however (which I also tried - out of curiosity!) - everything there seems to be lumped and compiled together regardless of whether it is needed or not.
Any help as to helping me with the above issues is greatly appreciated, many thanks in advance for taking the time!
Sounds like you would really benefit from hiring a consultant.
On 1/30/12 12:00 PM, Me wrote:
Apologies if any of the questions below are a bit dumb - I don't pretend to be an expert in SIP/VOIP - I am just an ordinary user looking for answers.
Our current setup involves processing a small number of internal sip accounts (up to 10, no more than that) and one "public" one (with a separate registrar) in the following way:
On our server we have three interfaces: eth0, eth1 and tun0. eth0 is our entry point to the public internet, eth1 faces our internal network and tun0 is a private vpn, which connects all our smartphones to the internal network (via Wifi, EDGE/2G/3G etc). This gives us the mobility.
Up until now, we have been routing voip calls via a commercial (closed source), very limited, terribly outdated (Pentium code base!) and rather buggy sip proxy. I had to employ a lot of hacks on our server in order to route calls as this proxy can only listen on a single interface. It was also a nightmare to maintain. Unsurprisingly, I decided that enough is enough and I am now determined to replace it.
We route calls in the following way: all machines (PCs are all Linux based) & smartphones have their own sip/voip client installed on them (also using bluetooth). Internal calls are routed via the proxy between ourselves either on the internal net (eth1), or between the vpn and eth1 (eth1<->tun0).
External calls (going out, i.e. outbound) are routed externally to our registrar, using a single separate voip account, via eth1<->eth0 or tun0<->eth0.
As I am now looking to replace our proxy, I looked at Kamailio, but was soon completely overwhelmed by it (no offence intended, it was just too much to take at first). I would appreciate if any of you could give me a hand, or at least point me in the right direction, with the following issues:
I presume I could configure Kamailio to listen on more than one interface and act as a proxy. How do I do that, so that it listens on all 3 interfaces and proxies requests in the following way:
- calls made to <userX>@ourdomain.net to be routed internally via eth1
(internal net) or tun0 (private vpn);
- calls made to anybody else to be routed externally via eth0 (public)
using the separate "public" sip account with our external registrar;
- calls made to the public sip account (from outside - the "public")
need to be routed to a "nominated" internall account (say <user0>@ourdomain.net);
- all other (internal) calls need to be routed depending on which
interface this account has been registered/logged in - either the internal net (eth1) or the private vpn (tun0 - the smartphones).
Obviously, calls need to be received (and routed properly) from all 3 interfaces.
Is all of this possible with Kamailio?
I want to avoid unnecessary complexities of the setup (as I already mentioned above - I am just a user and by no means an expert in sip/voip) and do not want to deploy something I do not need - I need to keep the memory footprint to a bare minimum, possibly without sacrificing performance.
Once this is done, I would then move on to the next phase and use IM & ENUM, but this is once the above works.
I looked at other alternatives, but I got very confused there as well
- I couldn't figure out what exactly is the difference between, say,
OpenSER, Kamailio, OpenSIPS and SIP-Router even? What is the best software to use in order to achieve the above setup?
One last thing - I am a developer by trade and I am not afraid of "tweaking" things when needed. I was successful in compiling Kamailio from source (I use Fedora on all our machines) and I was pleased that I could exclude from the RPM .spec file the modules I think I did not need.
I also made some modification of my own to make the database modules (mysql, postgresql and unixodbc) configurable in the same way the rest of the modules are. I could submit patches, if needed, so that these are incorporated into future releases - how do I do that?
I could not do the same with OpenSIPS, however (which I also tried - out of curiosity!) - everything there seems to be lumped and compiled together regardless of whether it is needed or not.
Any help as to helping me with the above issues is greatly appreciated, many thanks in advance for taking the time!
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
It's not a smart-arse reply; it's sincere, earnest advice. There's only so much of a massive conceptual nexus that people can reasonably traverse on a mailing list. For the most part, mailing lists exist to answer specific questions, not provide broad, fundamental guidance or extensive pedagogical surveys.
-- This message was painstakingly thumbed out on my mobile, so apologies for brevity and errors.
Alex Balashov - Principal Evariste Systems LLC 260 Peachtree Street NW Suite 2200 Atlanta, GA 30303 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/, http://www.alexbalashov.com
On Jan 30, 2012, at 5:44 PM, Me mojo1736@privatedemail.net wrote:
Sounds like you would really benefit from hiring a consultant.
Smart-arse replies are not appreciated - if you can't contribute just move along - nothing to see here!
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
It's not a smart-arse reply; it's sincere, earnest advice.
Really?! Perhaps you could explain to me how exactly is the "you should get a consultant" comment on a routine set of questions I posted on a mailing list created for that very purpose - for Kamailio users like myself - anything other than a smart-arse reply?
Does it answer any of my queries? No! Is it helping me in any way, shape or form? No (do you seriously think I haven't really thought of "getting a consultant" before posting my queries on this mailing list?)! Does it provide any insight or fresh ideas on either what I want to achieve or the difficulties I am facing, given the problems I described earlier? No! Does it contribute anything to the discussion on this mailing list, apart from wasting my own time and bandwidth so that I have to enlighten smart sparks like the previous poster as well as yourself? No!
There's only so much of a massive conceptual nexus that people can reasonably traverse on a mailing list. For the most part, mailing lists exist to answer specific questions, not provide broad, fundamental guidance or extensive pedagogical surveys.
I didn't ask for "fundamental guidance" or "pedagogical surveys". I asked to be pointed in the right direction where I could get (further) help. I did not force anyone to answer, let alone come up with "gems" like the one I commented on in my previous post.
I'd say it again though - this thread is for me to seek answers/advice/help/guidance - if you, the previous poster, or anyone else for that matter is unwilling or unable to provide one, then just move along - there is nothing to see here. Smart-arse comments like "get a consultant" isn't what I am looking for, nor is the reason for starting this thread on this mailing list.
You will need to break down your e-mail into several simpler questions and you will get some useful replies. Most of the things that you want to do are possible. To craft a proper e-mail to all your questions in your original e-mail would take quite some time ... and time is expensive for all. I think that's all that you need to read from all the replies that you got.
Now, to give you a hint on what are you trying to achieve, take a look at forced socket PV: http://www.kamailio.org/wiki/cookbooks/3.2.x/pseudovariables#forced_socket This will put you on the right track in sending SIP request through a specific interface.
Regards, Ovidiu Sas
For the sake of argument, let's say it was a smart-ass answer-- if your post was to "be pointed in the right direction where I could get (further) help" then that next help should either be:
a) the wiki b) a training class c) a consultant
On forums I notice that those who get a better response usually use their real name instead of "Me" with a private/alias email address.
To breakdown how I view your mail... if you're looking for a proxy, then yes, Kamailio is a great choice. If you're looking for an SBC, then no... Kamailio alone isn't your best choice; although it could be with some tweaking and (possible) use of other products. If you're looking for someone to help you with this complex question, and to learn about this product, I recommend B & C.
With best regards,
Fred Posner http://qxork.com
On Jan 30, 2012, at 7:13 PM, Me wrote:
It's not a smart-arse reply; it's sincere, earnest advice.
Really?! Perhaps you could explain to me how exactly is the "you should get a consultant" comment on a routine set of questions I posted on a mailing list created for that very purpose - for Kamailio users like myself - anything other than a smart-arse reply?
Does it answer any of my queries? No! Is it helping me in any way, shape or form? No (do you seriously think I haven't really thought of "getting a consultant" before posting my queries on this mailing list?)! Does it provide any insight or fresh ideas on either what I want to achieve or the difficulties I am facing, given the problems I described earlier? No! Does it contribute anything to the discussion on this mailing list, apart from wasting my own time and bandwidth so that I have to enlighten smart sparks like the previous poster as well as yourself? No!
There's only so much of a massive conceptual nexus that people can reasonably traverse on a mailing list. For the most part, mailing lists exist to answer specific questions, not provide broad, fundamental guidance or extensive pedagogical surveys.
I didn't ask for "fundamental guidance" or "pedagogical surveys". I asked to be pointed in the right direction where I could get (further) help. I did not force anyone to answer, let alone come up with "gems" like the one I commented on in my previous post.
I'd say it again though - this thread is for me to seek answers/advice/help/guidance - if you, the previous poster, or anyone else for that matter is unwilling or unable to provide one, then just move along - there is nothing to see here. Smart-arse comments like "get a consultant" isn't what I am looking for, nor is the reason for starting this thread on this mailing list.
Please re-read my original reply.
"Sounds like you would really benefit from hiring a consultant. "
Is not "get a consultant".
Its practical advice to help you get started.
You would benefit from it. Get your project done faster and move on. It also helps support the kamailio community. A small way to contribute back for the effort many have put in so far.
Just because that was not the answer you were looking for does not give you right to reply the way you did.
Next time you can simply say "Thank You" and reply back with "I was really hoping for a better explanation."
The information you asked for is all in the docs. Yes its a lot of information to digest.
Good luck.
On 1/30/12 7:41 PM, Fred Posner wrote:
For the sake of argument, let's say it was a smart-ass answer-- if your post was to "be pointed in the right direction where I could get (further) help" then that next help should either be:
a) the wiki b) a training class c) a consultant
On forums I notice that those who get a better response usually use their real name instead of "Me" with a private/alias email address.
To breakdown how I view your mail... if you're looking for a proxy, then yes, Kamailio is a great choice. If you're looking for an SBC, then no... Kamailio alone isn't your best choice; although it could be with some tweaking and (possible) use of other products. If you're looking for someone to help you with this complex question, and to learn about this product, I recommend B& C.
With best regards,
Fred Posner http://qxork.com
On Jan 30, 2012, at 7:13 PM, Me wrote:
It's not a smart-arse reply; it's sincere, earnest advice.
Really?! Perhaps you could explain to me how exactly is the "you should get a consultant" comment on a routine set of questions I posted on a mailing list created for that very purpose - for Kamailio users like myself - anything other than a smart-arse reply?
Does it answer any of my queries? No! Is it helping me in any way, shape or form? No (do you seriously think I haven't really thought of "getting a consultant" before posting my queries on this mailing list?)! Does it provide any insight or fresh ideas on either what I want to achieve or the difficulties I am facing, given the problems I described earlier? No! Does it contribute anything to the discussion on this mailing list, apart from wasting my own time and bandwidth so that I have to enlighten smart sparks like the previous poster as well as yourself? No!
There's only so much of a massive conceptual nexus that people can reasonably traverse on a mailing list. For the most part, mailing lists exist to answer specific questions, not provide broad, fundamental guidance or extensive pedagogical surveys.
I didn't ask for "fundamental guidance" or "pedagogical surveys". I asked to be pointed in the right direction where I could get (further) help. I did not force anyone to answer, let alone come up with "gems" like the one I commented on in my previous post.
I'd say it again though - this thread is for me to seek answers/advice/help/guidance - if you, the previous poster, or anyone else for that matter is unwilling or unable to provide one, then just move along - there is nothing to see here. Smart-arse comments like "get a consultant" isn't what I am looking for, nor is the reason for starting this thread on this mailing list.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Mojo-
I'm surprised at the replies you received. Normally the people on this group are extremely helpful.
Clearly you've spent significant time thinking about this, and your current system and problem description below is detailed and well-presented, with a clear rationale for using Kamailio.
As you've already successfully installed Kamailio, my suggestion would be to continue configuring that system as a parallel (shadow) system to your existing system and start experimenting with basic call routing. Just take it one step at a time, and as you encounter specific questions, post here and I'm sure you'll get great help.
David -- I'm sorry, but as one of the old guys on here, I have to stand up and say that really was an unfair response. After a new group member writes a multi-page description clearly stating he's already using a legacy commercial SIP proxy, you don't think he's already thought about a consultant and/or commercial software? C'mon.
-Jeff
Apologies if any of the questions below are a bit dumb - I don't pretend to be an expert in SIP/VOIP - I am just an ordinary user looking for answers.
Our current setup involves processing a small number of internal sip accounts (up to 10, no more than that) and one "public" one (with a separate registrar) in the following way:
On our server we have three interfaces: eth0, eth1 and tun0. eth0 is our entry point to the public internet, eth1 faces our internal network and tun0 is a private vpn, which connects all our smartphones to the internal network (via Wifi, EDGE/2G/3G etc). This gives us the mobility.
Up until now, we have been routing voip calls via a commercial (closed source), very limited, terribly outdated (Pentium code base!) and rather buggy sip proxy. I had to employ a lot of hacks on our server in order to route calls as this proxy can only listen on a single interface. It was also a nightmare to maintain. Unsurprisingly, I decided that enough is enough and I am now determined to replace it.
We route calls in the following way: all machines (PCs are all Linux based) & smartphones have their own sip/voip client installed on them (also using bluetooth). Internal calls are routed via the proxy between ourselves either on the internal net (eth1), or between the vpn and eth1 (eth1<->tun0).
External calls (going out, i.e. outbound) are routed externally to our registrar, using a single separate voip account, via eth1<->eth0 or tun0<->eth0.
As I am now looking to replace our proxy, I looked at Kamailio, but was soon completely overwhelmed by it (no offence intended, it was just too much to take at first). I would appreciate if any of you could give me a hand, or at least point me in the right direction, with the following issues:
I presume I could configure Kamailio to listen on more than one interface and act as a proxy. How do I do that, so that it listens on all 3 interfaces and proxies requests in the following way:
- calls made to <userX>@ourdomain.net to be routed internally via eth1
(internal net) or tun0 (private vpn);
- calls made to anybody else to be routed externally via eth0 (public)
using the separate "public" sip account with our external registrar;
- calls made to the public sip account (from outside - the "public")
need to be routed to a "nominated" internall account (say <user0>@ourdomain.net);
- all other (internal) calls need to be routed depending on which
interface this account has been registered/logged in - either the internal net (eth1) or the private vpn (tun0 - the smartphones).
Obviously, calls need to be received (and routed properly) from all 3 interfaces.
Is all of this possible with Kamailio?
I want to avoid unnecessary complexities of the setup (as I already mentioned above - I am just a user and by no means an expert in sip/voip) and do not want to deploy something I do not need - I need to keep the memory footprint to a bare minimum, possibly without sacrificing performance.
Once this is done, I would then move on to the next phase and use IM & ENUM, but this is once the above works.
I looked at other alternatives, but I got very confused there as well - I couldn't figure out what exactly is the difference between, say, OpenSER, Kamailio, OpenSIPS and SIP-Router even? What is the best software to use in order to achieve the above setup?
One last thing - I am a developer by trade and I am not afraid of "tweaking" things when needed. I was successful in compiling Kamailio from source (I use Fedora on all our machines) and I was pleased that I could exclude from the RPM .spec file the modules I think I did not need.
I also made some modification of my own to make the database modules (mysql, postgresql and unixodbc) configurable in the same way the rest of the modules are. I could submit patches, if needed, so that these are incorporated into future releases - how do I do that?
I could not do the same with OpenSIPS, however (which I also tried - out of curiosity!) - everything there seems to be lumped and compiled together regardless of whether it is needed or not.
Any help as to helping me with the above issues is greatly appreciated, many thanks in advance for taking the time!
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Jeff,
On 01/30/2012 06:59 PM, Jeff Brower wrote:
start experimenting with basic call routing. Just take it one step at a time, and as you encounter specific questions, post here and I'm sure you'll get great help.
I think that's all anyone was really saying:
Either learn the technology yourself, but recognise that it will be a slow and incremental process, and nobody can just impart, in a gestalt sort of way, the entire universe of necessary knowledge up-front, or procure commercial help, if efficiency/speed is the primary concern.
-- Alex
Come on, let's be reasonable here. People are very helpful here and do volunteer a great deal of time to help others solve their problems, but ultimately, people have jobs and there are only so many hours in the day.
I agree that the original post is well-thought out, extensive and structured, and certainly more precise and articulate than most of the "tell me everything I need to know!" posts we get here. And certainly, that does not go unnoticed or unappreciated. Nevertheless, to give proper treatment to all the questions posed, and to do so in a way that adequately resolves the conceptual dependencies on which a thorough, applied understanding of the answers is predicated, requires a magisterial compendium that is just not economical to provide.
You can go to a programming Q&A forum, for example, and ask specific questions about a piece of code, even elaborate ones, with many dependent clauses. But you can't realistically expect an answer if you show up and say: "Teach me how to program, and furthermore, upon doing so, teach me exactly how to implement this set of [non-trivial] desiderata". That would suggest a certain lack of pragmatism, or at the very least, experience with such forums.
start experimenting with basic call routing. Just take it one step at a time, and as you encounter specific questions, post here and I'm sure you'll get great help.
I think that's all anyone was really saying:
Either learn the technology yourself, but recognise that it will be a slow and incremental process, and nobody can just impart, in a gestalt sort of way, the entire universe of necessary knowledge up-front, or procure commercial help, if efficiency/speed is the primary concern.
I have absolutely no objection to that - I though I set it out pretty clearly in my initial post. I am no expert, so the learning curve would be even steeper for me, but it won't be the first time I am doing this sort of thing, so I am not afraid to take that path, if needed.
What I am not going to do though, is spent my time, energy and resources on something, just to find out midway through that it is not what I need or for some reason or other what I want cannot be achieved. My initial post on this thread served this very purpose - to gauge an opinion from people who possess more knowledge on the subject than myself and see if what I want to do is possible with Kamailio or any of the other (similar, in my view) products I listed in that post. It is the reason why I detailed my setup, so that opinions can be canvassed.
Admittedly, I forgot to mention 2 things, which I sort of taken for granted, but reading through I thought to mention this, just in case:
1. My eth0 interface (the one which connects me to the "outside" world) does not have a public IP address - it is connected to DHCP server of my ISP and obtains a private IP address. That ultimately means whatever system/software/product I use, it needs to find my public IP address (through STUN or other such means) and do a proper NAT. I take it this is possible with Kamailio, right?
2. As a matter of policy, all voice calls regardless of whether they are made internally (among ourselves) or to/from the public, are recorded and stored on that server. Is Kamailio capable of doing such thing or do I have to use some other means of obtaining that feature?
So, to summarise once again: at this stage I need to find out whether what I want to achieve is possible if I use Kamailio. If the answer is a resounding "yes" and there are no other - better, less painful and complex alternatives out there (and by that I don't mean "getting a consultant"!) - then I am ready to delve in and tackle these issues head on.
I have no illusions that it would be an easy ride - I realise that my understanding of Kamailio is almost nil, so the learning curve would be steep. That is why I want to make sure that I am not wasting my time for something, which ultimately won't fit or satisfy my needs.
To conclude this, I am grateful for your other - more detailed - post, but I would be able to digest its content once I am certain that the path I need to take with Kamailio is the right one for me. Thanks again.
All right, fair enough. I realise that this list has left you with little useful takeaways thus far, and, upon further reflection, that does seem a little unfair, given the amount of effort and thought that went into your post.
In due recognition of that, let me _try_ to tackle some of the more "low-hanging fruit" here, bearing in mind everything I've had to say about the practicality of the scope of your questions.
See below:
On 01/30/2012 12:00 PM, Me wrote:
External calls (going out, i.e. outbound) are routed externally to our registrar, using a single separate voip account, via eth1<->eth0 or tun0<->eth0.
As I am now looking to replace our proxy, I looked at Kamailio, but was soon completely overwhelmed by it (no offence intended, it was just too much to take at first). I would appreciate if any of you could give me a hand, or at least point me in the right direction, with the following issues:
It is understandable that you were overwhelmed. It is a relatively low-level, idiosyncratic software product, with its own programmatic route script language for configuration, and many associated, idiosyncratic APIs and conventions. The overall flow of the route script mimics aspects of the SIP state machine, and is tied to SIP message processing. You can think of Kamailio as something like an SDK on top of a proxy core. So, for starters, a fairly robust understanding of SIP protocol mechanics is required.
As much as efforts have been made to make it more user-friendly, it is something that really has little out-of-the-box functionality suitable for all but the most generic of implementation scenarios.
Roughly speaking, the stock configuration file is, to some extent by convention and to some extent by necessity, organised into three parts:
1. Global configuration values. 2. Module loading & module-specific parameters. 3. Routes.
Routes are like functions or subroutines. They are activated when a SIP message is processed. The canonical route is a request route, so it is fired when a SIP request is received (initial or sequential/in-dialog). There are other types of routes for SIP message types other than requests, like replies, and also for certain conditions that inhere in Kamailio's design, such as failure routes (for >= 3xx failure replies), event routes (functionality-specific callbacks), etc.
At the bare minimum, to do any routing, you need the single mandatory request route, which has no name:
route { ... }
All SIP requests pass through this main request route.
You can delegate functionality into other routes which can be called from the main request route, e.g.
route { ...
route(X); }
route[X] { ... }
All other types of routes are pretty much optional, and not essential to a "quick start" or getting going.
The root of all documentation is here:
http://www.kamailio.org/dokuwiki/doku.php
There are several components to the documentation tree:
- Core cookbook: core functionality, including route types, global configuration values, variables, primitives, operators, etc.
- Modules: http://www.kamailio.org/docs/modules/3.2.x/
Modules are optionally loadable and provide all non-core functionality. Note that some components of Kamailio are technically modular, but in practice, are essential to almost any commonplace use of it, so they can be regarded as core. These include: rr, xlog, tm, pv, sl. Your best guide for this aspect of things is the stock config file.
- Pseudovariables & selects: these are variables which are populated by Kamailio automatically to expose SIP message attributes. Most of these are immutable (read-only), while a few, such as the request URI ($ru), are mutable, so you can actually assign values to them.
- Transformations: these are mostly string-related operations that can be performed on variables of all kinds (user variables and pseudovariables), e.g.
$(ru{s.len}) -- get the length of the request URI string.
...
Your best bet is to take the stock configuration file and tweak it to your liking. I encourage you to conserve the sanity checking and request handling boilerplate you see at the top of the main request route, as that is stuff you are going to want in virtually any imaginable scenario. In particular, don't make the common rookie mistake of deleting the
if(has_totag()) { ...
if(loose_route()) { ... } else { ... } }
section. Sequential (in-dialog) requests with a preset route set (i.e. Route header) must be routed differently than initial requests; routing then manually is poor form.
I presume I could configure Kamailio to listen on more than one interface and act as a proxy. How do I do that, so that it listens on all 3 interfaces and proxies requests in the following way:
You just bind it to all three interfaces with multiple 'listen' parameters, e.g.
listen=udp:xxx.xxx.xxx.xxx:5060 listen=udp:yyy.yyy.yyy.yyy:5060 listen=udp:zzz.zzz.zzz.zzz:5060
If you want to have Kamailio take its best shot at guessing which interface to route out of, set
mhomed=1.
If you want to guide this process manually, just modify the $fs pseudovariable prior to relaying a message, or use force_send_socket(), e.g.
$fs = "udp:xxx.xxx.xxx.xxx:5060";
# This will go out of the xxx.xxx.xxx.xxx:5060 socket.
if(!t_relay()) { sl_reply_error(); exit; }
- calls made to <userX>@ourdomain.net to be routed internally via eth1
(internal net) or tun0 (private vpn);
- calls made to anybody else to be routed externally via eth0 (public)
using the separate "public" sip account with our external registrar;
- calls made to the public sip account (from outside - the "public")
need to be routed to a "nominated" internall account (say <user0>@ourdomain.net);
- all other (internal) calls need to be routed depending on which
interface this account has been registered/logged in - either the internal net (eth1) or the private vpn (tun0 - the smartphones).
You can get the destination domain of a request by accessing the request URI attributes, e.g.
$ru - the whole request URI. $rU - the user part of the request URI. $rd - the domain part of the request URI. $rp - the port part of the request URI.
e.g.
if($rd == "ourdomain.net") route(INTERNAL_ROUTE);
Getting Kamailio to act as a UAC to register with an external registrar is a little complex, since Kamailio is a proxy, and proxies are not UACs, so they are not capable, at least, as a formal matter, of initiating requests or registering to anything. However, Kamailio has this functionality hacked in, in the form of its 'uac' module:
http://www.kamailio.org/docs/modules/3.2.x/modules_k/uac.html
In particular, there is a 'uacreg' table you can use to get it to initiate and maintain registrations with an external SIP provider. But this is a rather involved topic.
Obviously, calls need to be received (and routed properly) from all 3 interfaces.
Is all of this possible with Kamailio?
In principle, yes.
There are complications you will encounter along the way, particularly if you want Kamailio to stay in the signaling path of sequential (in-dialog) requests, which you would do using by inserting the Record-Route header using the 'rr' module's record_route() function. Multiple interfaces require careful handling.
If you don't care about the proxy seeing BYEs or reinvites, your life will be much simpler in a multihomed scenario.
I looked at other alternatives, but I got very confused there as well
- I couldn't figure out what exactly is the difference between, say,
OpenSER, Kamailio, OpenSIPS and SIP-Router even? What is the best software to use in order to achieve the above setup?
This is a complex and somewhat politically charged topic, but in general, the lineage is something like this:
OpenSER | | | | Kamailio | \ | \ | \ | OpenSIPS | Kamailio+sip-router
SER is the common ancestor to this entire technology stack. OpenSER is the open-source variant that appeared in 2005. In 2008, its name was changed to Kamailio due to trademark-related issues, and at about the same time, OpenSIPS was forked from it. OpenSIPS is considered a rogue fork around here, and by this point has diverged significantly. I don't know that this list is the best place to get an opinion on the possible benefits of using OpenSIPS, but I can tell you that most of the people involved in managing the hitherto joint OpenSER project stayed with the Kamailio effort and, in my opinion, it has a lot more industry power and ecosystem behind it.
The sip-router project is an initiative that resulted in the recombination of Kamailio with the original SER, to leverage the best of both worlds. You can think of sip-router as a "kernel" and Kamailio as a particular packaging/distribution of it. For all practical purposes, they are the same thing, as far as you should be concerned. In other words, Kamailio has sip-router underneath.
-- Alex
Kamailio can do this. Asterisk also can do this, and for small number (less then few thousands of clients, may be Asterisk is even better - my personal opinion ). You can install kamailio, and put its default conf file and - you are ready to start tweaking. If Kamailio have to register to other sip server as client - I am not sure it is possible, but Asterisk can do it easy. Everything else is easy. Kamailio will call users by their respective address - and you will not care how it will look for IP or interface. Or you can make some routing in its conf file and that's all. You will need to read, then to read, again you will need reading, testing etc. Open source products are free. You can get them and use them in a way you wish for free. But you must know how to use them, and this is not that easy. I spent around 2 months to make what I need. And at the end, I fixed some problems dirty way, because I dont know better way.
On Mon, Jan 30, 2012 at 7:00 PM, Me mojo1736@privatedemail.net wrote:
Apologies if any of the questions below are a bit dumb - I don't pretend to be an expert in SIP/VOIP - I am just an ordinary user looking for answers.
Our current setup involves processing a small number of internal sip accounts (up to 10, no more than that) and one "public" one (with a separate registrar) in the following way:
On our server we have three interfaces: eth0, eth1 and tun0. eth0 is our entry point to the public internet, eth1 faces our internal network and tun0 is a private vpn, which connects all our smartphones to the internal network (via Wifi, EDGE/2G/3G etc). This gives us the mobility.
Up until now, we have been routing voip calls via a commercial (closed source), very limited, terribly outdated (Pentium code base!) and rather buggy sip proxy. I had to employ a lot of hacks on our server in order to route calls as this proxy can only listen on a single interface. It was also a nightmare to maintain. Unsurprisingly, I decided that enough is enough and I am now determined to replace it.
We route calls in the following way: all machines (PCs are all Linux based) & smartphones have their own sip/voip client installed on them (also using bluetooth). Internal calls are routed via the proxy between ourselves either on the internal net (eth1), or between the vpn and eth1 (eth1<->tun0).
External calls (going out, i.e. outbound) are routed externally to our registrar, using a single separate voip account, via eth1<->eth0 or tun0<->eth0.
As I am now looking to replace our proxy, I looked at Kamailio, but was soon completely overwhelmed by it (no offence intended, it was just too much to take at first). I would appreciate if any of you could give me a hand, or at least point me in the right direction, with the following issues:
I presume I could configure Kamailio to listen on more than one interface and act as a proxy. How do I do that, so that it listens on all 3 interfaces and proxies requests in the following way:
- calls made to <userX>@ourdomain.net to be routed internally via eth1
(internal net) or tun0 (private vpn);
- calls made to anybody else to be routed externally via eth0 (public)
using the separate "public" sip account with our external registrar;
- calls made to the public sip account (from outside - the "public") need
to be routed to a "nominated" internall account (say <user0>@ourdomain.net );
- all other (internal) calls need to be routed depending on which
interface this account has been registered/logged in - either the internal net (eth1) or the private vpn (tun0 - the smartphones).
Obviously, calls need to be received (and routed properly) from all 3 interfaces.
Is all of this possible with Kamailio?
I want to avoid unnecessary complexities of the setup (as I already mentioned above - I am just a user and by no means an expert in sip/voip) and do not want to deploy something I do not need - I need to keep the memory footprint to a bare minimum, possibly without sacrificing performance.
Once this is done, I would then move on to the next phase and use IM & ENUM, but this is once the above works.
I looked at other alternatives, but I got very confused there as well - I couldn't figure out what exactly is the difference between, say, OpenSER, Kamailio, OpenSIPS and SIP-Router even? What is the best software to use in order to achieve the above setup?
One last thing - I am a developer by trade and I am not afraid of "tweaking" things when needed. I was successful in compiling Kamailio from source (I use Fedora on all our machines) and I was pleased that I could exclude from the RPM .spec file the modules I think I did not need.
I also made some modification of my own to make the database modules (mysql, postgresql and unixodbc) configurable in the same way the rest of the modules are. I could submit patches, if needed, so that these are incorporated into future releases - how do I do that?
I could not do the same with OpenSIPS, however (which I also tried - out of curiosity!) - everything there seems to be lumped and compiled together regardless of whether it is needed or not.
Any help as to helping me with the above issues is greatly appreciated, many thanks in advance for taking the time!
______________________________**_________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/**cgi-bin/mailman/listinfo/sr-**usershttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users