Creating a peer for the SIP provider

A SIP account will need to be created both from the Provider and in the sip.conf file. When creating a SIP account on the providers web site you will need to enter in a public IP address. You can determine the public IP address of your location by visiting the page https://lecturesnippets.com/myip.php (Links to an external site.)Links to an external site.. For this course, a SIP account named LectureSnippets has been created on the SIP providers website.

Within the documentation of questblue.com there is information on how to create a SIP account used to connect to their server. Each provider may have their own settings needed to connect.  Below are the settings based on what is required from the SIP provider, with some modification to meet the needs of this course. They will allow a connection to the SIP account named LectureSnippets at Questblue. Open the /etc/asterisk/sip.conf file and add the information to connect to your own SIP account.
[LectureSnippets] type=peer
host=sbc.questblue.com
insecure=invite
context=provider
qualify=yes
dtmfmode=rfc2833
nat=force_rport,comedia
fromdomain=sbc.questblue.com

The insecure=invite option tells Asterisk that it does not need to authenticate the INVITE requests that come from the registered SIP provider.

The context=provider puts this SIP account in a separate context for the dialplan. This way it does not have direct access to the extentions in the [phones] context created earlier, unless we program it in.

The qualify=yes option may have been set in the [general] section. In the event that it was not, it can be set for this peer specificaly. In this case, it checks the connection of the SIP provider.