how asterisk work with VoIP trunk?

Home » Asterisk Users » how asterisk work with VoIP trunk?
Asterisk Users No Comments

On Thu, 9 Jun 2011, virendra bhati wrote:

> I mean when we call on DID then call will come to my server and then I
> want to move this call to any SIP extension. But call will not come to
> extension just got message “device not in use”. But device already
> registered into asterisk server.

I’m not an expert in SIP messaging. Hopefully, my description will not
materially mislead you.

A SIP call is initiated by sending an INVITE. This starts a dialog where
the 2 endpoints exchange messages to determine authentication, which
codecs are available and which will be used, the ports to be used for RTP
(audio), messages signaling ‘in-call’ DTMF, and messages requesting the
termination of the call.

When a caller calls the DID you are renting, the termination provider will
send your Asterisk server an INVITE. The provider knows where to send the
INVITE either because your Asterisk server REGISTERed with the provider or
because you told the provider the host name or IP address of your Asterisk
server.

When your provider and your Asterisk server have agreed upon all the
details, Asterisk will start executing your dialplan at the context
matching the context specified in sip.conf. The extension within the
context is taken from one of the SIP headers in the INVITE. Probably the
INVITE header or the TO: header. The priority within the exten will be 1.
There are extension pattern matching rules so you don’t have to specify
every possible extension.

When you want to forward the call to an extension, you execute the ‘dial’
application, specifying the destination endpoint which starts another SIP
dialog similar to above and then Asterisk bridges the 2 channels.

HTH.