Koozali.org: home of the SME Server

SAIL - a couple of thoughts

WillKemp

SAIL - a couple of thoughts
« on: May 15, 2006, 11:58:00 PM »
HI!

Well, i got incoming calls working, but it wasn't the firewall that was blocking them, as i thought previously, it was my type=user config in sip.conf. I've never used the two-part sip account config before - only configured everything as type=friend. When i configured my voise.com.au (DID) account using my old type=friend config, it worked.

Now http://voip-info.org/wiki/view/Asterisk+SIP+user+vs+peer says

Quote
As of Asterisk 1.2, there is no reason to actually use 'user' entries
any more at all; you can use 'type=peer' for everything and the behavior
will be much more consistent.

and i'd like to be able to configure new carriers with just the type=user stanza. However, when i do that, SAIL still sticks stuff in the right-hand (user) box on the "Change Trunkline" page.

How can i stop it doing that? I know it can be done, because the Sipgate carrier config does it.

Also, i want to be able to direct incoming calls to one extension and, if that's not available, to a second (and maybe third) one - In the same way as the primary, secondary, tertiary and quaternary paths are done in the "Add or Modify a Route" page. There doesn't appear to be a way to do this.

However, i just (since i wrote the above paragraph) noticed that now i've installed 2.1.11-193 i can do it by definining that bit of extensions.conf in the Custom Apps and directing the inbound route to that. If i can work out how to get a call into that bit of script, that is. Maybe the 's' extension will do it. No time to try it now, i'll have a go this evening.

Anyway, overall i'm really impressed - both by how functional SAIL is, and by how far it's come since i last checked it out (a year ago?).

Will

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - a couple of thoughts
« Reply #1 on: May 16, 2006, 11:02:13 AM »
Hi Will,
Quote
As of Asterisk 1.2, there is no reason to actually use 'user' entries
any more at all; you can use 'type=peer' for everything and the behavior
will be much more consistent.

Absolutely right and has been since around 1.0.9 CVS.  The reason we have peer/user and haven't removed it is twofold; backward compatibility and that fact that many carriers specify long, often unnecessary, user strings and our users would feel uncomfortable if they couldn't use them.  In any event, it's doing no harm so we'll keep it for now.   However, there should be the ability to specify "peer only" or "friend" at trunk define time so we'll look at that.  In the meantime, you can fiddle it by placing a single comment line (;) in the definition and using a dummy SIP/DID entry.
Quote
Also, i want to be able to direct incoming calls to one extension and, if that's not available, to a second (and maybe third) one


Depends what you mean by "not available".   The call-forward processing in SAIL is among the best around.  In fact it's the ONLY Asterisk implementation we know of with true loop and spiral detection (and for that reason alone, being old telephony kiddies, we wouldn't deploy any other offering professionally), but enough of the advertising :-)...

You can set your phones to call forward on Busy or no answer (*22*) and that will do it for you .  However, if you really want a true hunt group, you can wait a couple of releases (it's on the list) or you can do it yourself in a custom app using the "s" extension.  

Kind Regards

jeff@selintra.com

WillKemp

SAIL - a couple of thoughts
« Reply #2 on: May 16, 2006, 11:31:00 AM »
Quote from: "selintra"
In the meantime, you can fiddle it by placing a single comment line (;) in the definition and using a dummy SIP/DID entry.

The carrier entry for Sipgate, which comes with SAIL, doesn't appear to have anything in the right hand side definition and when you configure a trunkline using Sipgate, it comes up with nothing in the right hand side definition. How is that done?

Is there any documentation on the mechanics of the SAIL config system?

Quote
Depends what you mean by "not available".

Phone not online, busy, or unanswered.

Quote
You can set your phones to call forward on Busy or no answer (*22*)

Ah, that sounds reasonable. I never thought of doing it PBX-style. I'm afraid i think in terms of extensions.conf etc... I'll give it a try.

Will

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - a couple of thoughts
« Reply #3 on: May 17, 2006, 12:43:19 AM »
Quote
The carrier entry for Sipgate, which comes with SAIL, doesn't appear to have anything in the right hand side definition and when you configure a trunkline using Sipgate, it comes up with nothing in the right hand side definition. How is that done?
Hi Will,

The Trunk definitions are inherited from the carrier definition.  By default (in line with your earlier point about users and peers), when you create a carrier, no user definition is created.  If you want to have user entries you must then go back and physically update the carrier definition.  Sipgate, as an example, was created without any user entries.  When a new Trunk inherits Sipgate characteristics, the user entry is empty.  You can do it yourself by simply creating your own definition for a particular carrier.
Quote
Is there any documentation on the mechanics of the SAIL config system?

Not really.  There is a full admin guide at www.selintra.com/docs however it doesn't contain any detail on the underlying mechanics.  However, we intend to address that soon. Not that there's any rocket science.  SAIL is actually a very simple little system.  There are only three component layers:-

The panels, they just update the selintra database (which itself is a vanilla SME DB) and invoke the generator.

The generator - just  simple SME Server templates to create the Asterisk .conf files from the DB.  

The AGI, - the run-time sequence control.

Overall, there's surprisingly little code in SAIL and most of what there is can be found in the front-end panels.  The rest is just copy, paste and sequence control.  :-)

Best

jeff@selintra.com

WillKemp

SAIL - a couple of thoughts
« Reply #4 on: May 17, 2006, 01:25:38 AM »
Quote from: "selintra"
The Trunk definitions are inherited from the carrier definition.  By default (in line with your earlier point about users and peers), when you create a carrier, no user definition is created.  If you want to have user entries you must then go back and physically update the carrier definition.

I created one or two carrier entries with no user definition, but when i create a trunk definition using that carrier, it puts about 3 lines in the user definition (that weren't in the carrier definition). This is why i asked about it. I'm at work at the moment and i haven't got access to my SME box from here, so i can't check what lines it puts in there.

Another thing, while i'm writing... I don't seem to be able to get routes working properly and Asterisk doesn't log what's going on in any detail - as it seems to be happening at AGI level (verbose=4). Is there any way i can monitor what's actually happening when i dial a number that should be being routed to an ITSP through a configured route? Where does logging of AGI processes happen?

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - a couple of thoughts
« Reply #5 on: May 17, 2006, 02:43:38 AM »
Quote
it puts about 3 lines in the user definition
hmmm - it shouldn't.  That's how sipgate works.  I've only got -180 here. -  I'll try it on 192 in the office tomorrow.
Quote
I don't seem to be able to get routes working properly
Let me know what it's doing that you don't like.

To see what's happening... Stop Asterisk and restart it like this...
Code: [Select]
/etc/init.d/asterisk stop
asterisk -vvvvvvvvvvvc

when it comes up, at the CLI do
Code: [Select]
agi debug
when you've finished
Code: [Select]
agi no debug
stop now
/etc/init.d/asterisk start


Best

WillKemp

SAIL - a couple of thoughts
« Reply #6 on: May 17, 2006, 04:01:33 AM »
Quote from: "selintra"
To see what's happening... Stop Asterisk and restart it like this...
Code: [Select]
/etc/init.d/asterisk stop
asterisk -vvvvvvvvvvvc

I believe more than 4 x 'v's (i.e., verbosity level of 4) doesn't make any difference.

But stopping and starting is like using a sledgehammer to crack the proverbial nut, anyway! It's much easier to just do:

set verbose 4

The equivalent to the 11 x 'v's you've got there, would be set verbose 11 . But http://www.voip-info.org/wiki/view/verbose says setting verbosity greater than 4 gives a verbosity of 1. That certainly doesn't apply to the number of 'v's on the command line, and i can't check if it's true for the CLI command at the moment - it doesn't seem right though. I think setting verbosity greater than 4 gives a verbosity of 4, but i could be wrong there.

Quote
when it comes up, at the CLI do
Code: [Select]
agi debug

Ah... That's what i want. I should have just had a look at the output of the help command, shouldn't i? ;-)

I'll check it out when i get home.

Thanks
Will

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - a couple of thoughts
« Reply #7 on: May 17, 2006, 08:15:53 AM »
Quote
I believe more than 4 x 'v's (i.e., verbosity level of 4) doesn't make any difference.

But stopping and starting is like using a sledgehammer to crack the proverbial nut, anyway! It's much easier to just do:....
You're right, it is easier... you just may not see anything. The AGI debugger writes its output to the master console.  

As to the number of v's?  You can do 4 if you want, but personally, I just press the v key for a bit.   ;-)


Best

Jeff

WillKemp

SAIL - a couple of thoughts
« Reply #8 on: May 17, 2006, 09:05:27 AM »
Quote from: "selintra"
Quote
You're right, it is easier... you just may not see anything. The AGI debugger writes its output to the master console.


Ah. Ok. I thought you were suggesting shutting it down just to start up again with extra verbosity.

Thanks
Will

WillKemp

SAIL - a couple of thoughts
« Reply #9 on: May 17, 2006, 11:07:26 AM »
Quote from: "selintra"
You're right, it is easier... you just may not see anything. The AGI debugger writes its output to the master console.

I'm getting AGI debug output on the remote console with no problems.

I didn't really need it though, because as soon as i started trying to debug the problem i was having, i realised the carrier was Pennytel and remembered i'd read somewhere (in an email Burnat sent me, i think) that there was a problem with the supplied Pennytel config. So i deleted that carrier config and re-did it and now it works...

However, the thing with not being able to get an empty "user" config seems to have got weirder - well, sort of.

When i created the new Pennytel carrier config, the user part came up empty - which it hasn't done before, there's always been something in it. Maybe this is different in this version (-193)? And when i create a new trunkline with it, it comes up empty too. So no problem there.

However, when i try and delete the user config part from a previous carrier definition that i created a few days ago (under an earlier version), i can't. I delete it and save the config, but it comes back again.

Of course this isn't a real problem, as all i have to do is delete that carrier template and re-create it and all should be ok. It's just weird...

Will

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - a couple of thoughts
« Reply #10 on: May 17, 2006, 12:28:59 PM »
Quote
It's just weird...


Nah, - it's not weird.  It's a greenie :-o

I'll see if we can't sort it out for you.  Until then, you can go all the way back to my first suggestion and just put a single comment in the user definition.  Now some people may call that a bodge, but I prefer to think of it as a "circumvention", at least that's what I've put in Bugzilla. :-)

Jeff

WillKemp

SAIL - a couple of thoughts
« Reply #11 on: May 17, 2006, 01:10:08 PM »
Quote from: "selintra"
I'll see if we can't sort it out for you.  Until then, you can go all the way back to my first suggestion and just put a single comment in the user definition.  Now some people may call that a bodge, but I prefer to think of it as a "circumvention", at least that's what I've put in Bugzilla. :-)

But there's no need to. Because, as i said above, it works. It's only the old configs that act like that. If i create a new carrier config, -193 seems to do the whole thing perfectly ok.

However, while i'm writing... Another thing that occurs to me is that it might be good to be able to have the g729 codec being optionally configured even without a g729 licence. The g729 codec isn't copyright in Australia, so we don't need a licence.

It's no really big deal having to edit the config by hand, of course, and probably not worth worrying about. Just a passing thought...

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - a couple of thoughts
« Reply #12 on: May 17, 2006, 01:33:56 PM »
Quote
Another thing that occurs to me is that it might be good to be able to have the g729 codec being optionally configured even without a g729 licence. The g729 codec isn't copyright in Australia, so we don't need a licence.


Whoa!  That's interesting.  I wonder why that is.  We have to pay 10 bucks a pop here.  However, Asterisk has some gubbins in it which recognises registered G729 instances.  If you do
Code: [Select]
show g729
on a box that has no registered instances you get...

Code: [Select]
test7*CLI> show g729
No such command 'show g729' (type 'help' for help)


Contrarywise, if you issue the same command on a box that does have g729 licenses you get...

Code: [Select]
*CLI> show g729
0/0 encoders/decoders of 3 licensed channels are currently in use
*CLI>


So how would we square that?

Best

Jeff[/quote]

WillKemp

SAIL - a couple of thoughts
« Reply #13 on: May 17, 2006, 11:13:44 PM »
Quote from: "selintra"
[Whoa!  That's interesting.  I wonder why that is.  We have to pay 10 bucks a pop here.

To be honest, i can't remember the exact reasons now, but it's something to do with Australian copyright or patent law (whichever applies) - which is different from country to country. No doubt there are plenty of other places in the world where the situation is the same.

There are at least a couple of free g729 codecs available. Whether it's legal to use them in any given country, of course, is another matter.

Quote
Code: [Select]
*CLI> show g729
0/0 encoders/decoders of 3 licensed channels are currently in use
*CLI>


So how would we square that?

The only thing i can suggest off the top of my head is the show translation command - which will have figures in the g729 column (or row) if there's a codec installed, but will have all dashes there if not.

Will

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
SAIL - a couple of thoughts
« Reply #14 on: May 18, 2006, 10:12:29 PM »
Hi Will,

I didn't explain my last post very well.  The point I was badly trying to make is that I don't think that Asterisk will actually do any g729 translation if it thinks there are no licenses registered on the system.  There are various vague references on the asterisk BB's to an open-source g729 codec (which apparently isn't GPL), but I have no idea what would happen if you fitted it.  The Digium variant won't tanslate unless licences are present.  If I'm right then it raises some interesting issues as a far as the law in your country is concerned.

Best

Jeff