Search

Wednesday, July 21, 2010

Some examples of configuring DID in Asterisk

We have many clients using HK DID (852-5804-) and China DID (86-400-) from a HK-based DID provider.  Recently, we encountered a client using several DID providers from the US and needed us to setup an (Interactive Voice Response System) IVRS in Hong Kong to handle inquiries from his US customers.
 
This client is using didforsale.com, didww.com and didx.net.  In the first place, we have to setup Asterisk, primarily in the sip.conf, to accept SIP calls from these providers.  Below highlights the parameters required in sip.conf.
 
sip.conf
[general]
; to setup the default context for all incoming calls
context=ivrs-context
 
 
didforsale.com
 

[didforsale]

type=friend

host=209.216.2.211

canreinvite=no

insecure=very

disallow=all

allow=ulaw

allow=alaw

allow=g729

nat=yes

context=ivrs-context

 

In the provider's configuration page, we have to input below information.

q       Manage IP

o       Input our-asterisk-ip to receive DID calls

q       Manage DID

o       Map DIDs to our-asterisk-ip

   

 

didww.com
 

[didww_us4]

dtmf=rfc2833

dtmfmode=rfc2833

host=204.11.194.38

insecure=very

type=peer

context=ivrs-context

nat=yes

disallow=all

allow=alaw

allow=ulaw

 

In the provider's configuration page, we need to create custom mapping because the default one will not send the called number to Asterisk.

 

didx.net

 

[didx]

dtmf=rfc2833

dtmfmode=rfc2833

host=208.44.220.234

insecure=very

type=peer

context=ivrs-context

nat=yes

canreinvite=no

relaxdtmf=no

disallow=all

allow=ulaw

allow=alaw

 

In the provider's configuration page, we need to update ring-to-address to did@ivrs-ip-address

e.g.,15672512762@ivrs-ip-address.

 
 
Above all, we also need to check whether there are any firewall rules that block sip calls from these provider.  Note that we use G711 with some providers.  The customer intends to make certain DIDs as fax-in numbers, though the reliability will not be as good as traditional PSTN fax.  In this case, we just could not use a lossy codec like G729.
 
 
 
 

2 comments:

  1. Hi

    I've been searching about DID on asterisk for a while but I couldnt find so much information except the definition of DID.Your post seemed detailed to me so I have a question..In sip.conf why dont we declare the boundaries of our numbers(e.g it starts from 1111000 to 1111999)?Is ip declaration enough?If so how our peers supposed to register to the system.Long story short I m really confused about DID.Does somebody have answer to my question or from where I can find brief and satisfying information about DID?

    ReplyDelete
  2. We need the DID to receive inbound calls to our asterisk. It is accomplished by creating a sip peer to the DID provider's ip and therefore ip declaration is applicable here (note the use of type=friend or peer). Any handling of number range should be done in extensions.conf (eg routing the DID to your extensions, IVR, etc.)

    Btw, please look up www.voip-info.org and you will find a lot of DID information.

    ReplyDelete