Resolving extension not found in the context trunkinbound Error

 Vicidial is a powerful open-source call center suite, widely used for inbound and outbound call management. However, users may encounter the "extension not found in the context trunkinbound" error when dealing with incoming Direct Inward Dialing (DID) numbers containing the '+' sign infront of the DID number. This issue can be frustrating, but with the right solutions, you can ensure a smooth call flow. In this article, we'll explore the root cause of the problem and provide step-by-step instructions to resolve it.

extension not found in the context trunkinbound

Understanding the Issue:

    The error message "handle_request_invite: Call from 'siptrunk' to extension '+1234567890' rejected because extension not found in the context trunkinbound" typically occurs when Vicidial encounters incoming DIDs with a '+' sign. The system fails to match the incoming number with a valid dialplan extension in the specified context, leading to the error. To address this vicidial have provided the solution but its not activate by default.

Here is the default dialplan under trunkinbound context in vicidial

exten => _X.,1,AGI(agi-DID_route.agi)
;exten => _+1X.,1,Goto(trunkinbound,${EXTEN:2},1)
if you have noticed the line no 2  where vicidial have provided the dialplan to match the incoming number which starts with '+' but it is commented means not active.

Steps to Resolve the Issue:

    Login to your vicidial server console via SSH using putty, and use your favorite linux editor either vi or nano and edit the file extensions.conf file and uncomment the line -  that is remove the ';' , save the file and reload the asterisk
vi /etc/asterisk/extensions.conf
followed to the edit it should look like
exten => _X.,1,AGI(agi-DID_route.agi)
exten => _+1X.,1,Goto(trunkinbound,${EXTEN:2},1)
Note:  Modify this dialplan according to your requirement, This dialplan is written for US numbers which starts with 1 as first digit. so modify the dialplan according to your requirement. 
As per this dialplan the  first digit should be + and followed by 1, and the line  {EXTEN:2}  will remove the + and 1 and send the remaining digits to the first dialplan ie: exten => _X.,1,AGI(agi-DID_route.agi) which will then processed by vicidial DID settings.

For example if your incoming DID is +919988776655 then you need to discard + only then edit dialplan as per below
exten => _+91X.,1,Goto(trunkinbound,${EXTEN:1},1)
If you need to remove +  as well 91  then use the below dialplan 
exten => _+91X.,1,Goto(trunkinbound,${EXTEN:3},1)
Followed to the Dialplan modification dont forget to reload the asterisk
asterisk -rx "dialplan reload"
Now add your DID under Vicidial admin portal under inbound settings and test the incoming calls.


    Resolving the "extension not found in the context trunkinbound" error in Vicidial related to incoming DIDs with the '+' sign involves adjusting dial plan and context settings. By following the steps outlined in this article, you can eliminate this issue and ensure a seamless call experience. Remember to test thoroughly after making changes to guarantee the successful resolution of the problem. For support reach me on skype or telegram: striker24x7

No Comment
Add Comment
comment url