How to setup a sip trunk?

Hello everybody !

I am new to Asterisk ! I just installed Elastix and try to figure out how to setup the following scenario:

A phone company provides me with a sip account: I got a sip-server (, a user and a password. Now what I want is that my Asterisk server captures the calls that come in through that sip account and makes a call distribution on various internal sip accounts which are connected by x-lite clients. I mean that I want that incoming phone calls go first on the internal sip account 1, if this one is occupied, then to sup account 2, etc.
So far so good, now how to make the setup? If I understood it right I need to create a sip trunk in order to “capture” the sip-account that my phone company provides and send it to a Queue which defines in which order the incoming phone calls will be addressed to the internal sip-accounts.
Is that correct so far?

If so, I stuck on the first step which would be to setup a sip trunk: What is the “user context”?
There is this option “context=from-trunk”, should I leave it like that?

Thanks a lot for any hint on this !

Best regards,


              put ur user name in the user context.


Since this message is a few days old, I’m going to assume that you may have figured it all out, but just in case, here are a few hints:

You have to figure out if the company is treating you as a peer or an extension (they would be treating you as an extension if they expect you to use a VoIP adapter such as a Sipura/Linksys). If they are treating you as an extension then any details you put in the user section will be ignored. That includes the context statement, which must then be moved into the peer details. I know this is counterintuitive but that’s just how things work. See for examples of this.

Once you have that set up properly, you should be able to set things up the way you want in incoming routes, directing the calls to either a follow-me or a ring group, whichever seems more appropriate in your situation.