SIP trunking is the method of sending calls to ITSP service provider using sip protocol.
Indepth details refer RFC 3261
There are two types of authentications
1. IP based authentication
2.Username and Password based authentication
For IP Based Authentication
You need to do the following changes in the sip.conf
[siptrunk]
type=friend
fromuser=X.X.X.X ( your asterisk server ip ) which will send traffic to the service provider
host=X.X.X.X ( service provider ip )
canreinvite=no
qualify=no
dtmfmode=RFC2833
context=intenal
disallow=all
allow=g729
allow=ulaw
allow=alaw
port=5060
Then you need to edit extensions.conf
[intenal]
exten => _9X.,1,Dial(SIP/${EXTEN}@siptrunk)
For Username and password based authentication
[siptrunk]
type=friend
username=
fromuser=X.X.X.X
host=X.X.X.X
canreinvite=no
secret=
qualify=no
dtmfmode=RFC2833
context=intenal
disallow=all
allow=g729
allow=ulaw
allow=alaw
port=5060
define username and password to it