1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Check out the 6 new Certified Incredible PBX Builds for Asterisk 11 and 13 featuring CentOS 6, Ubuntu 14, Raspberry Pi 2, and Asterisk-NOW.
    Dismiss Notice

DID Configuration Setup

Discussion in 'Help' started by Tron, Jun 20, 2009.

  1. Tron

    Tron New Member

    I am trying to configure a DID from DIDforSale.com to my PIAF 1.4 installed and hope someone can give me a hint of how to do this.
    Here is my question.
    According to DIDforSale.com support document, I need to add the following to my Asterisk box.

    Add the code below to your ’sip.conf‘ file
    host=[IP ADDRESS OF OUR SERVER - didforsale]

    Add the code below to your ‘extensions.conf ‘ file
    exten => _X.,1,Set(CALLERID(num)=${CALLERID(num):1}) ;This line removes the “+” in front of the CallerID.
    include => from-trunk
    ;[you can forward it to your default context]


    In my FreePBX, Tools, Config Edit,
    I do not see sip.conf or extensions.conf files and it is not recommended to edit those files manually.

    There are files below;


    I would like to know which file I should add the configuration file above from didforsale.com to my Asterisk&2Billing in the FreePBX screen.

    Thank you very much for your support.
  2. jroper

    jroper Guru


    The sip.conf stuff goes into FreePBX as a SIP trunk.

    You will just have to make some minor changes to suit FreePBX e.g. the context will be "from-trunk" and insecure very would be port,invite
  3. also have to allow anonymous sip as well...

    also in your hosts file. you can not have your FQDN in there. it causes problems. I was working with their tech support people for about 3 days and then when they called me i was actually able to find a solution for them for future reference....

    let me know if you need a sample config to try in the FreePBx admin console
  4. timlitw

    timlitw New Member

    I'd love to see a sample config.
  5. jroper

    jroper Guru


    These are their original settings, copied for comparison with my suggested new ones:

    Lets convert this into something a little more FreePBX friendly.

    So name of trunk - say "DID-For-sale"

    the Peer details:-

    type=friend ;we want to make and receive calls - potentially!
     host=<<DID-For-Sales IP Address>> ;put their IP address here, as we want to authenticate on the IP address
     nat=yes ; You are probably behind NAT.
     canrinvite=yes; Your audio stream may go wrong if you re-invite
     disallow=all ; Disallow all codecs
     allow=ulaw ;allow the ulaw codec
     allow=alaw ; allow the alaw codec you could probably leave these 3 lines out.
     dtmfmode=rfc2833 ; sets the DTMF mode.
     insecure=port,invite ; allows authenticated calls from the IP address above, so that allow anonymous SIP is not required. "very" is deprecated.
     context=from-trunk; this is the context which is controlled by inbound routes.
    qualify=yes ; just so we can see some registration information, but optional.
    I hope that this throws some understanding on the matter.

    Alternatively, you could just set allow anonymous to yes, make sure you add the DID as delivered, and then add a catchall route with the DID _. which you send to hangup, then you don't need to bother with a trunk at all.

    This method (IMO) is considerably more secure than leaving it to no, and letting every chancer in the world send a SIP call to your PBX, and have it play "Sorry not in service" thus telling the other end that you have FreePBX, and if they send a few more calls, they will bring your PBX to its knees playing "sorry not in service messages."

    With the method described above, people can only ring you if they know your number - just like old-fashioned telecoms!

  6. vcallaway

    vcallaway Guru

    Here are my settings:

    For trunk named didforsale:

    In the box PEER details
    That's it.

    You should not have to allow anonymous but you will have to allow the two host addresses listed above through your firewall. didforsale does not do a sip registration, it is a straight sip call to your box.

    Just create an inbound route for your number from didforsale and you are set.

    I did not bother to put in anything to remove the plus from the caller id. The callerid superfecta does not seem to have an issue with it.

    If you need to strip the plus you would edit the extensions_custom.conf file and insert before the "#include extensions-away-status.com" line the following:

    exten => _X.,1,Set(CALLERID(num)=${CALLERID(num):1}) ;This line removes the “+” in front of the CallerID.
    include => from-trunk
    Back in the PEER details box change from-trunk to from-didforsale

Share This Page