Asterisk setup telnyx UK

I have tried making a working asterisk server and tried using this tuturial

I am using ubuntu 22.04 and when I try connect to my sip phone it says connection in progress (nothing wrong with internet) it is definetly to do with the server of asterisk and I also need help doing a dial plan for number 5 in the tuturial I am a noob and it would be nice to get support of discord but begger can’t be choosers.
I know my spelling is bad don’t tell me thanks

The Telnyx docs look fine to me, but keep in mind that this setup is based on a couple of assumptions about your net, that actually may or not may apply.

As far as the dialplan goes, there’s still the basic Asterisk book online, that goes through all the steps you need to know.

That said, Asterisk is more of a component toolbox rather than an end user application. You need to know your internet and local net topology very well and understand what all these modules are actually doing. Just saying…

It looks broken to me. In particular:

endpoint/callerid = Bart <1001> 

I don’t know how the configuration parsing will handle this. It could vary from not recognising 1001 as a valid keyword, and simply ignoring it, though throwing out the whole template, to throwing out the whole PJSP configuration and not loading the module.

One way or another, these lines:

exten => _+1NXXXXXXXXX,1,Dial(PJSIP/1001)
exten => _NXXXXXXXXX,1,Dial(PJSIP/1001) 

will not work, as no endpoint 1001 has been defined.

I’m a bit uncomfortable with letting transport default, but I think it may be OK.

I don’t understand why they are defining Bart and Lisa; that’s not the preferred way of doing multiple devices with the same extension number, when using chan_pjsip. Much more useful examples would have been those for devices corresponding to extensions 1002 and 1003.

I don’t think hint_exten will do anything, as auto hints don’t seem to have been enabled. The documentation is poor, so I’m not sure what happens when multiple endpoints use it, and, in any case, it doesn’t seem to have been used for 1001 (making certain assumptions about what was really intended in the document.

There are settings that are probably unnecessary.

The use of full North American national number dialled and E.164 format patterns, basically matching every possible North American number, for the incoming extension, is unusual, but should work for getting started, as long as they use one of those formats.

For outgoing calls it assumes you do not provide the carrier select codes, so dialling will not be like on a directly connected landline phone. Again this is North America specific.

Although they have given endpoints for local phones, they haven’t provide dialplan that would allow calls between them without going through Telnxy.

The phoneprov settings, although part of the pjsip configuration are not settings for pjsip and make assumptions about the phones and other modules, which are likely wrong.

Personally I would rather than did not use wizards, as I find it much easier to be sure things are correct with the long form.

Generally, rather than trying to guess how to fix this, I think you need to get some good logging. Go to logger.conf, and uncomment the full log. Start asterisk and note any warnings and errors, other than modules you are not using. At the CLI issue “pjsip show endpoints”, and “core set verbose 5”, and capture the output
from /var/log/asterisk/full. That will help us see why the call is failing and what configuration you actually have.

As already said, you really want to understand your system and how the configurations work. That’s especially true when using raw Asterisk, although I’d argue that it is also true when using systems that try to dumb things down, a little, like FreePBX, which may still be too powerful for you. If you want simplicity, you need to buy a complete system, including both phones and switch.

Typos, etc. don’t count (and one can easily take of that when one knows what is required) and I would not use the wizard myself. Even if there is a perfectly valid configuration file, there’s still the problem of figuring out how all of this applies to the own environment. It’s only simple if one does not know a lot. The more one knows, the more subtle the questions get, which implies that it is difficult to talk to someone who just starts to work with Asterisk and by the same token it is difficult to give a specific advice to those who ask for it.

Meanwhile I have different setups (for Kamailio) for service providers who use stateful or stateless proxies and offer NAPTR DNS lookups. Try to communicate that…

You can buy a complete system, but there’s a certain chance that you run into NAT problems. That depends on what kind of router is used, and the telephone guy may be able to solve that or not.

BTW, it’s not my box.

However, they have used an explicit transport to connect to them, which does not match the transport they have defined!

Whilst I mentioned the North American style numbers, I missed the UK in the subject. The dialplan simply is not compatible with UK numbers, which are, for a start, variable length. Even if you are buying a US number from them, I assume you intend to call, and receive calls from, numbers which are not in North America.

For simple dialplan you should look at Chapter 6. Dialplan Basics and asterisk/extensions.conf.sample at master · asterisk/asterisk · GitHub adjusting for using PJSIP instead of SIP and noting that not all SIP/ dial string syntaxes apply, so you should refer to Dialing PJSIP Channels - Asterisk Project - Asterisk Project Wiki

Basic dialplans are something you should learn from documentation, or pay to have written. The forum is for when you get stuck on specific details.

For endpoints, you should refer to res_pjsip Configuration Examples - Asterisk Project - Asterisk Project Wiki noting that your chosen provider does’t seem to require type=auth and type=registration sections and the references to them. You should also look at asterisk/pjsip.conf.sample at master · asterisk/asterisk · GitHub for more complex examples, and, if necessary, PJSIP Configuration Sections and Relationships - Asterisk Project - Asterisk Project Wiki for the full documentation.

Assuming you have at least two phones, and especially if they are real phone hardware, I’d suggest getting them working without Telnyx first.

For security reasons, you should either use an unguessable name, instead of telnyx, as the section name, or you should specify indentify_by=ip, for the endpoint (presumably endpoint/identify_by=ip). At the moment anyone who knows you are using telnyx can make incoming calls, although their dialplan doesn’t allow incoming callers to make outgoing calls, so it should be safe from toll fraud.

This issues came up in the FreePBX forum.

This is what I changed to the /etc/asterisk/extensions.conf to try make it work for the UK.
exten => _+44XXXXXXXXXXX,1,Dial(PJSIP/1001)
exten => _+44XXXXXXXXXX,1,Dial(PJSIP/1001)
exten => _XXXXXXXXXX,1,Dial(PJSIP/1001)
exten => _XXXXXXXXXXX,1,Dial(PJSIP/1001)

exten = _XXXXXXXXXXX,1,Dial(PJSIP/+1${EXTEN}@telnyx)
same = n,Hangup()

exten = _XXXXXXXXXX,1,Dial(PJSIP/+1${EXTEN}@telnyx)
same = n,Hangup()

exten = _X.,1,Dial(PJSIP/+${EXTEN}@telnyx)
same = n,Hangup()

However this is giving me many issues. Is there a indepth video or tuturial for setting up asterisks which is for any provider and I can just change the host to mine etc this would be helpful. Also if anyone happens to have discord and can help please add me on Seyar#6997 I would appriciate that as I find it easier to learn verbally or by watching a video however if someone can link a tuturial that would be great thank you so much for all the help guys and feeback :slight_smile:

I don’t think one can really given general guidance beyond that in the pjsip sample configurations document, and even that doesn’t cover your IP only based configuration.

Normally, in from-pstn, one would only match the specific numbers allocated to you (some people call these DIDs, however that is a distortion of the original meaning of DID). If they really give you them in both national number dialled (or raw dialled) format and E.164, you will need to cover both.

For reasons given below, your first incoming number pattern will never match any valid UK number.

You won’t be able to dial 999, with your configuration, which would be illegal in the USA, at least for a business (911, rather than 999), and probably makes the sample configuration illegal. If they insist on E.164 format numbers, you are never going to be able to dial 999, 112, 101, 111, etc. I’d suggest you find out how these can be handled, or arrange an alternative provider for them. I suppose they might treat +999 as an emergency code, rather than a request for country 999…

National number dialled (i.e. excluding the 0) for UK numbers are of length 9 and 10, and there are some Free Phone and Lo (sic) Call numbers that are only 7 digits. Your dialplan only covers 10 and 11 digit ones (Telephone numbers in the United Kingdom - Wikipedia).

Your dial plan attempts to treat outgoing calls, of the matched lengths as ones to the North American Numbering Plan area, and requires an explicit country code for other numbers.

It appears that Telnyx don’t require you to use E.164 format, with the +, on outbound calls, in which case a pattern that catches everything other than local numbers might be sufficient, and less confusing to users. SIP Connection: Number Formats | Telnyx Support

Please note that you would need to address these numbering issues on any PABX, not just Asterisk.

I am only doing outbound calls and users are not allowed to dial emergency numbers as that is not this will be used for nor will it be allowed so I don’t need that. I also don’t mind using credentials as well as IP as long as I can get this to work. Also this will only be for outbound calls not inbound. However it still doesn’t work and I think I might just quit seeing as nothing seems to work. I try connecting to a softphone it never connects.

I don’t know what the law is in the UK, but my understanding is that, in the US, they must be able to dial emergency numbers. (It looks like the requirement is that employees and visitors should have access to a phone capable of calling 999, but it can be outside the main corporate system, although this may get tightened up, in the future.)

As I already said, your dialplan attempts to dial numbers in North America, if you dial the most common formats of UK number. e.g. for an older, central London, number, it expects you to dial 20 7xxx xxxx, which will match:

exten = _XXXXXXXXXX,1,Dial(PJSIP/+1${EXTEN}@telnyx)

and result in Telnyx being sent +1207xxxxxxx, which is a, potentially invalid, number in Maine USA.

If they actually dial 0 20 7xxx xxxx, as I’d expect a normal UK telephone user to do, it will match

exten = _XXXXXXXXXXX,1,Dial(PJSIP/+1${EXTEN}@telnyx)

and attempt to send +10207xxxxxxx which, as far as I know, is a malformed inbound number, to the North American area.

The ability to call just 7xxx xxxx, if you are in London, is, I believe, being withdrawn, but UK users may still want to consider allowing the dropping of the area code part, like this.

As I noted above, Telnyx seem to say that they will accept 0207xxxxxxx as well as +44207xxxxxxx, so there is, possibly, no need to transform the number dialled.

If you really don’t accept inbound calls, you should either delete the from-pstn section, or add code to reject them, possibly with a recorded announcement. Also, you should check the regulations, as there are circumstances (direct marketing and automated calls) where it is not allowed to present a caller ID for a number that won’t work.

Well I have now tried setting up on FREEPBX but and I got it to connect however when I try call somoeone it says forbiden I really need help via a call to sort this as it would be fixed within 10min if I shared my screen and someone guided me please ANYONE who could help me via discord Seyar#6997 I am willing to pay for help via discord too as I need this done ASAP and I am running into to many problems

I believe that Sangoma have paid support services for FreePBX, although I think that the minimum time is rather more than 10 minutes.

I would rather use asterisk completely rather than use freepbx if somone had the time to help which it shouldn’t take long and can offer £50 (which is $59) on completion discord is Seyar#6997. I already know how to install asterisk it is just getting it to work with telnyx which I am having issues with.

When you base you system on Asterisk, then you are essentially doing development/integration work. You won’t get far with 50 quid. For a reliable system, I’d think that you have to multiply that by a factor of 100. Sangoma paid support is actually not a bad option. Above all, you’d benefit from their experience.

If you come with unusual requirements, then you might find not anybody who is willing to help you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.