Koozali.org: home of the SME Server
Obsolete Releases => SME VoIP (Asterisk, SAIL etc) => Topic started by: del on November 09, 2006, 01:01:24 AM
-
Hi All,
I am getting a bit bored since my SAIL/Asterisk as been working OK :D So I have decided to try and understand transformation masks :? I have read the docs at http://www.selintra.com/docs and I think I understand the principle of anything before the : transforms into whatever is after the : Where I am getting confused is the relationship between transformation masks and dialing routes :? Example if I enter 407:001407 as a mask for trunk 1 then what do I put in the route to use that same trunk? Would it be _407. or _001407. :roll: Thanks in advance.
Regards,
Del
-
Hello Del,
The mask is applied by the Selintra AGI just before it issues the dial statement. The dialplan you create in the route does its work much earlier.
Here's a route dial plan and a trunk mask for a SAIL box running in the 407 area-code...
_011X. _1NXXXXXXXXX _NXXXXXXXXX _NXXXXXX
and...
:1407 1407407:1407 14071407:1407 1407011:011
It should work for 7 digit local numbers, 10 digit 407 numbers, 11 digit (1 + area code + subscriber number) national numbers and international numbers.
I haven't run this mask on a live box so YMMV. It should be close tho' :-)
Just fire up an asterisk console in verbose mode and start dialing. You should see on the console what the mask is doing to your dialed numbers.
You have to be very strange to be good at masks :twisted:
So... if the above masks don't work then I'm not as strange as I thought I was...
Er... I'll go now...
Kind Regards
Selintra
-
Hi Selintra,
Before I try out your suggestions I perhaps should have pointed out that I am using voipdiscount for my outgoing calls and they require me to dial 00 then the country code and then the number, so a local call like 407-123-4567 would need to be dialed as 0014071234567 (unlike Bellsouth where it would be 1234567). Sorry but I just can't grasp this masking bit :shock:
Regards,
Del
-
Aha
Then try
_011X. _1NXXXXXXXXX _NXXXXXXXXX _NXXXXXX
and...
:001407 001407407:001407 0014071:001 001407011:00
:-)
Transformation examples - the number on the left is the number dialed at the phone. The number on the right is the number which SAIL will dial after transformation using the above mask. Numbers in the middle are intermediate values that the mask willl generate on its way to the final output.
LOCAL........ 2222300 -> 0014072222300
AREA.......... 4072222300 -> 0014074072222300 -> 0014072222300
NATIONAL... 15136624100 -> 00140715136624100 -> 0015136624100
INTERNAT.... 011441924918076 -> 001407011441924918076 -> 00441924918076
Let me know how you get on.
Kind Regards
Selintra
-
Hi Selintra,
That works like a dream :D I have tried a local call with and without the area code and a UK number and they all worked OK. I will have to study the mask because I am still not 100% sure how it works and I am the sort of guy that won't be happy with the fact that it works, I need to understand it as well :D
I am going to help my mate in the UK who also uses voipdiscount but most of this is covered in the docs at selintra.com/docs I will maybe post my efforts here before I actually try them live :roll: While I think about it I did as you said in a previous post to set up his SPA-3000 and that worked fine. So once thanks again for all your help.
Regards,
Del
-
Hi Selintra,
I think I have worked out a mask and route for my mate in the UK :D
He is also using voipdiscount so all numbers need to be presented as 00 + country code + area code eg. 01905123456 is dialed as 00441905123456 01905 being his area code.
So would this work?
Route:
_00x.
Mask:
:00441905 00: 0:0044
My limited ability tells me that:
LOCAL - 123456 -> 00441905123456
NATIONAL - 01785123456 -> 00441785123456
INTERNATIONAL - 0014071234567-> 0014071234567
I think :?
Thanks for looking.
Regards,
Del
-
Hi Del
I think you are getting the hang of it but you may have missed a few corner cases -
Try
:00441905 0044190500:00 004419050:0044
Best
Selintra
-
Hi Selintra,
Thanks for the mask, was the route OK? Also is there a way to set up a different route for his BT line connected to the SPA-3000? He gets free calls to UK mobiles with this line but not with voipdiscount, in fact would he be able to dial a UK mobile which I believe are 07xxxxxxxxx with the mask you gave me to try? If not then maybe I could just add _07. as a route in the BT trunk :) Thanks again.
Regards,
Del
-
The route isn't quite right. x's should be capitalised X. Also, because the mask runs after the route has been taken, most of your dials will be ignored by _00X.
Instead, you want to allow 6 digit numbers through and also UK national and international numbers. So a better route plan might be...
_00X. _0X. _XXXXXX
If you want to go further, you can slicken up your code by avoiding "." characters. When asterisk sees a dot it doesn't know how many more digits are going to arrive so it relies on the send key (or #) or the long timeout to decide when the dial has finished. This doesn't usually matter with SIP phones but it can be a pain when using clunky old analogue phones or DECT units through an ATA. If you specify exact lengths asterisk will recognise the dial faster. So, a better dial plan might be...
_00X. _0XXXXXXXXXX _0XXXXXXXXXX XXXXXX
You now have only one dot; in the international dial. UK National numbers can be 11 or 12 digits so we cater for them both and finlly we cater for your 01905 local calls which are 6 digits (some areas, like London, are 7). Lastly, let's ignore 07 (UK mobile) numbers, because you want to shove them down a different route. So this route becomes...
_00XXXXXXXXXX. _0XXXXXXXXXX _0[8-6]XXXXXXXXX XXXXXX
Now you can create another route with a dialplan of...
_07XXXXXXXXX
and you can shove that out over a different trunk.
Kind Regards
Selintra
-
Hi Selintra,
I have been working away for a couple of days, so I will try these routes this weekend. Thanks.
Regards,
Del
-
This mask seems to be working for me for Telasip in the US.
From the 520 area code:
:1520 1520520:1520 15201520:1520 1520011:011 15201:1
G
-
Nice
You win the official "I can think sideways" mask-award
:-)
Kind Regards
Selintra
-
Selintra,
My colleague and I both carry Nokia E series phones and these work a treat with your software. javascript:emoticon(':D')
Very Happy
Two issues though, we want to be able to call number of the format +XXX YYY YYY YYYY. The numbers are stored in our phones in that format and we have valid reason for not wanting to change that format. How would we make this work.
Second issue, we are still trying to figure out how to transfer an incoming call all our trails have failed. We are newbies to Asterisk.
javascript:emoticon(':oops:')
Embarassed
Lebeko
-
Hi Guys,
Glad you like our little system.
Re your +XXX number - I assume that the "+" is inserting the international dial code? (e.g. in UK, "+" would actually dial "00" which is the UK IDD (International direct dial). In any event you need to trap the actual number you want to dial.
Lets say its 1234. So, your number (+XXX YYY YYY YYYY) is 1234 YYY YYY YYYY.
OK so far?
You can now remove the 1234 in the trunk mask by putting
1234:
I hope I correctly understood your question. Please let me know if I've wrongly answered.
Re transfer.
In the Asterisk/SIP world there are two ways you can transfer a call. One is with a SIP INVITE and the other is with an Asterisk "in-band" command. SAIL is set-up to accept either, although we normally prefer to use SIP INVITE in our own installations.
You must first figure out if the SIP stack on your Nokia is capable of issuing a transfer INVITE. This should be covered in the software guide for the phone. If it is then you can just use the SIP transfer facility built into the Nokia SIP stack. SAIL Asterisk will respond correctly to the INVITE and transfer the call.
The "other" way to transfer a call is in-band using DTMF. For blind transfer, press the # key once. This should play "Transfer" followed by a dial tone. Dial the number you wish to transfer to and hang up.
For attended transfer press #2. Do this quite slowly, don't rush it. The Asterisk DTMF sensor is a bit flaky. This should play "Transfer" and give you dial tone. Dial the number you wish to transfer to and when the third party picks up you can announce the call and hang-up.
Kind Regards
Selintra