Question

I am renting a sip did. I was told this could be passed to my pbx and to simply provide the ip of the server. I have done so but am now being told that I must accept their invite. I cannot seem to find a definitive answer. In order to accept an external did, is a trunk required. The provider has also said the number can originate from a range of ips. In what file should I define this range. Any info is appreciated.

Was it helpful?

Solution 2

You should probably setup trunk so you can define the parameters (i.e. codec, dtmf) that match that provider and also to designate a context. Without an explicit context, the call will be forwarded to the default context. To address multiple addresses you can use config templates to keep the configuration to a minimum. Define the trunk template with all the needed trunk parameters and then inherit the trunk settings for each IP.

Example trunk for multiple addresses in sip.conf

    [provider1](!)
    type=peer`
    dtmfmode=rfc2833
    insecure=invite,port
    context=inbound
    disallow=all
    allow=ulaw
    qualify=no

    [provider1A](provider1)
    host=1.1.1.1
    [provider1B](provider1)
    host=1.1.1.2
    [provider1C](provider1)
    host=1.1.1.3

Finally, you will need to determine what DNIS is being used. When the call arrives, it will match the trunk with the correct IP address, and then forward it to the dialplan using the context defined in the template. That context needs have an dial pattern that matches the DNIS, so that you can determine how to route the call. If you don't know the DNIS, you can determine it by applying verbose output at the console or reading the log files. If you do not have a catch all pattern match, you'll see output with regard to 'Rejected because extension not found in context'. Whatever that extension is will be the pattern you need to match for.

OTHER TIPS

Thoughtprov pretty much has it on the nose. That having been said, I'd strongly recommend that you take the time now to read "The Asterisk Book" online.

http://the-asterisk-book.com/1.6/

... the chapter on SIP trunks and talking to the PSTN is at: http://the-asterisk-book.com/1.6/minimale-telefonanlage.html#min-anlage-festnetz

It's a nice walk-through of a very basic but functional PBX with Asterisk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top