In this lesson we will redirect the incoming calls to an extension in the dialplan.
In the previous lesson a SIP account was created for [LectureSnippets]. The context for this account was set to provider. We will need to create this context to put instructions in for incoming calls. By placing this account in a different context than the other phones it will separate it from having direct access to all the extensions, unless programmed in.
When phone calls come into the Asterisk system, they can be coming from all over the world. We will need to setup an extension that can handle any phone number that calls in. We will use _X. as the extension.
The Goto() application can be used to redirect a phone call within the Asterisk system. We will use three parameters: context, extension, and line number) Using the application an incoming call can be directed any any of the phone extensions in the dialplan.
To add a new context named [provider] and redirect all calls to exten 100 in the [phones] context add the following information to the /etc/asterisk/extensions.conf file
[provider]
exten => _X.,1,Goto(phones,100,1)
The dialplan will need to be reloaded in the Asterisk console. After it is reloaded try calling the assigned DID number from your SIP provider to test if the phone number is directed to the SIP account [matthew] at extension 100.