Asterisk, voip.co.uk and multiple incoming numbers
|
| Author |
Message |
paulboakes
Joined: Dec 29, 2005
Posts: 23
Status: Offline
|
| Posted:
Jan 26, 2008 - 10:23 PM |
|
|
Hi,
(also posted in voip.co.uk support forums)
Not sure where to put this - a google hasn't turned up any useful answers, so I thought I'd post here.
I use voip.co.uk for my incoming traffic, and one of the many Betamax companies for most of my outgoing traffic, with a selection of calls (which I know will be in excess of 60 minutes) via voip.co.uk.
I have a few incoming numbers: one, which is a public number, is configured in Asterisk to ring only between 08.00 and 22.00, and then going to Asterisk's voicemail outside those times. A second, which is a private number, rings any time, 24x7. This has been a model I used before moving to VOIP a year back, and it's worked reasonably well with voip.co.uk since then.
How I've done this is to pick multiple numbers, create multiple SIP accounts, or 'targets', and then create multiple trunks in Asterisk, and have a single registration for each trunk. Now it seems to me that this isn't realiable: sometimes the registrations drop out - randomly - and sometimes incoming calls just wont' work (tonight, for example, they get a NU from a PSTN line).
Is this the best way of doing things? It struck me earlier that maybe I should have a single trunk, and figure out what call is going where by use on inbound routing - is that possible? I'm wondering if multiple registrations, multiple trunks, multiple SIP accounts and multiple targets is the 'right' way of doing it, and I' m thinking probably not.
I'd love to hear from someone who has done something similar, or could explain how I should be doing it - my way just doesn't seem to be the most practical way, and not scalable at all.
Any advice would be gratefully received! I can certainly post me specific details, configs, etc, if that would help.
Regards
Paul |
|
|
|
 |
paulboakes
Joined: Dec 29, 2005
Posts: 23
Status: Offline
|
| Posted:
Jan 27, 2008 - 08:38 PM |
|
For those insterested, I got a very helpful response from voip.co.uk, which is at:
http://forum.voip.co.uk/read.php?6,305
However, I've not got much of a clue on how to do what Theo suggested, and I can't beleive I'm the only person (or one of very few, in that case) with multiple numbers from voip.co.uk all pointing at one asterisk box, and then doing inbound routing based on the number dialled.
Theo's explanation, above, makes perfect sense: seems the only real option is to ensure that each inbound number is from a different VOIP provider, but that's even messier!
Somebody, please help!
Regards
Paul |
|
|
|
 |
paulboakes
Joined: Dec 29, 2005
Posts: 23
Status: Offline
|
| Posted:
Jan 28, 2008 - 08:12 PM |
|
This is moving along now - I've managed to strip out the dialled number (the DID number in Asterisk-speak), but I'm now unclear where to send the call so I can route it.
First of all, I get the DID of the trunk by this method:
http://www.aussievoip.com.au/wiki/How+to+get+the+DID+of+a+SIP+trunk
| Code: | [custom-get-did-from-sip]
exten => _.,1,Noop(Fixing DID using information from SIP TO header)
exten => _.,n,Set(pseudodid=${SIP_HEADER(To)})
exten => _.,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => _.,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => _.,n,Goto(from-trunk,${pseudodid},1) |
However, when I do the Goto part of that, I end up going to the [from-trunk] context with the DID number as the extension... as I don't have an 0208xxxxx07 extension, the call fails:
| Code: | Jan 28 20:01:44 logger.c: -- Goto (ext-did,020xxxxxx07,1)
Jan 28 20:01:44 pbx.c: Channel 'SIP/934346-0881ecd8' sent into invalid extension '020xxxxxx07' in context 'from-trunk', but no invalid handler |
What I want to do is route this into the Inbound Routing, so I can route it from there, but it seems that this isn't doing it.
Can anybody help? I'm bashing my head against the wall with this one.... I know I've missed something, but I've been working on this for a few days now...
Regards
Paul |
|
|
|
 |
paulboakes
Joined: Dec 29, 2005
Posts: 23
Status: Offline
|
| Posted:
Feb 12, 2008 - 08:47 PM |
|
Just to follow up on this, I eventually got it to work, and inbound routing now takes care of it. All down to a typo.
However, I've still got this problem where incoming calls randomly and intermittently fail to work. Theo over at voip.co.uk suggested:
| Quote: | It's also common with asterisk for calls to be rejected due us having multiple SBC's and (even if SRV is disabled) a couple of those SBC's being in the proxy.voip.co.uk A record - asterisk is broken in that it will perform a lookup for the IP address, choose one to register against, but incoming calls will only match the first IP in the A list, not the second.
While we stick outbound calls to the SBC you are registered against, asterisk's behavior means that this doesn't even work and calls are rejected because they're matching your default context in sip.conf rather than the expected peer.
I'm afraid there is no fix for this - it's a bug in asterisk, and one that i reported many years ago (infact, i think i wrote a patch for it at one point - goodness knows where it is now though!) that still, in 1.4 doesn't appear to be fixed.
The work around you can use is to make sure the binding you register in sip.conf will match an extension in your main context, as well as any you define for voip. Horrible, i know - but that's asterisk for you.
Another way would be for you to define multiple peer entries for all our of SBC's in. The problem with this is we regularly add new ones and temporarily remove others while performing maintainable, so it's not really a feasible solution and you're better off just making a rule to route from your default context.
|
...but I've not got a clue on how to do this. Can anyone point me in the right direction?
Thanks
Paul |
|
|
|
 |
satphoneguy
Joined: Sep 01, 2007
Posts: 113
Status: Offline
|
| Posted:
Feb 13, 2008 - 01:05 AM |
|
|
as a general rule the provider that you have chosen are not among the most reliable. the betamax group is known for pricing not quality or reliability. this could be part of your problem. they also have a reputation for canceling and/or blocking account when used from asterisk. another possibility to consider is the internet connection being used. multiple provider in itself should not be an issue of reliability. but reliability does vary from provider to provider and so the selection of the providers can determine the reliably in general. for the inbound it may make sense to have all calls come from your DID provider direct to your asterisk; in theory at least this would generally take away the possibility of degradation by the route in between. of course there could be exceptions to this as well; for example if your DID was in one area and you had another provider in that area with a more reliable dedicated IP link that comes close to your residence/place of business. i would recommend experimentation as the best way to judge quality. |
|
|
|
 |
troffasky
Joined: Oct 28, 2005
Posts: 9
Location: newcastle
Status: Offline
|
| Posted:
Apr 01, 2008 - 10:01 AM |
|
| satphoneguy : | | as a general rule the provider that you have chosen are not among the most reliable. the betamax group is known for pricing not quality or reliability. this could be part of your problem. |
I don't think it is in this case - the OP was referring to inbound problems with DIDs, which he is using voip.co.uk for, not Betamax. |
|
|
|
 |
troffasky
Joined: Oct 28, 2005
Posts: 9
Location: newcastle
Status: Offline
|
| Posted:
Apr 01, 2008 - 12:27 PM |
|
| paulboakes : |
| Quote: |
The work around you can use is to make sure the binding you register in sip.conf will match an extension in your main context, as well as any you define for voip. Horrible, i know - but that's asterisk for you.
|
...but I've not got a clue on how to do this. Can anyone point me in the right direction?
|
Every extensions.conf has a [default] context. The behaviour of Asterisk, as Theo has pointed out, is to send unknown SIP calls to [default]. If you don't have an extension in [default] called 123456 [or whatever], then the call will be rejected, for example:
| Code: |
[Apr 1 09:47:17] NOTICE[29714]: chan_sip.c:13885 handle_request_invite: Call from '' to extension '123456' rejected because extension not found. |
My register string with voip.co.uk has /123456 on the end:
| Code: |
register => 123456:abcdefg@proxy.voip.co.uk/123456
|
So voip.co.uk sends calls to 123456@ my Asterisk box. Now, I've set the context in sip.conf for voip.co.uk to incoming_voipcouk. In extensions.conf, there is a context called [incoming_voipcouk], and in that context there is an extension 123456 that simply Dial()s a list of SIP extensions. That is how I get my calls from voip.co.uk. Sometimes calls come from a different voip.co.uk server than the one my box registered with:
| Code: |
-- ast_get_srv: SRV lookup for '_sip._udp.proxy.voip.co.uk' mapped to host sbc1.b.synergy.voip.co.uk, port 6060
-- ast_get_srv: SRV lookup for '_sip._udp.proxy.voip.co.uk' mapped to host sbc2.b.synergy.voip.co.uk, port 6060
|
, in which case Asterisk will ignore the call, because there isn't an extension 123456 in [default]. As an experiment, I created an extension 123456 in [default] that only Dial()s one extension. Then when I made a few test calls in to my voip.co.uk number, some of them rang one extension and some of them rang all the extensions. I didn't have any rejected calls.
I hope that clears things up a bit! |
|
|
|
 |
|
| Forum Rules and Guidelines |
About VoIP User |
Privacy Policy
|
All logos and trademarks in this site are property of their respective owner. Comments and posts are property of the poster, all the rest (c) 2003-2006 VoIP User.
No part of this site may be reproduced without our prior consent.
|
|