Solution for "Extension 's' Rejected Because Extension Not Found" in Asterisk

    In the dynamic landscape of call centers and VoIP solutions, Vicidial stands as a robust platform, offering a seamless experience for handling incoming calls. However, users may encounter a perplexing issue on incoming calls where asterisk cli shows "chan_sip.c:15147 handle_request_invite: Call from '12345' to extension 's' rejected because extension not found".  This particularly occurs with incoming calls where the DID is not known by asterisk via the SIP trunk. In this comprehensive guide, we delve into the intricacies of this challenge and provide a definitive solution to ensure uninterrupted call flow.

extension 's' rejected because extension not found

Understanding the Root Cause

    To effectively address the issue at hand, it's crucial to comprehend the root cause of the rejection. The error message indicates that the DID information is not recognized or known within the asterisk of Vicidial system. This often occurs when the Direct Inward Dialing (DID) information is not received or known to asterisk PBX system , SIP trunk misconfiguration, SIP provider not sending the DID information directly , or no Context is matched  in asterisk.

Solution for extension s rejected

SIP Trunk Configuration Issues: Problems with your SIP trunk configuration, such as incorrect context settings or registration string issues, could also lead to this error.

Registration string with DID: Mention your DID extension in your SIP registration string as shown below and reload the asterisk

register => username:password@host:port/DID
eg register => striker:i2$$Iiissi@10.10.10.10:5060/1234567890

Sip peer Type and context : Make sure you have mentioned the type as friend in your sip trunk configuration with proper context name as shown below, set the context as per your need, here i set it as trunkinbound, for freepbx use from-pstn.

[siptrunkname]
type=friend
username=xxxxx
secret=xxxxx
context=trunkinbound
Derive DID from SIP header: In Asterisk, using the dial function SIP_HEADER(to) we will retrieve the value of the "To" header from the initial SIP INVITE request. where the 'To" value contains the DID number. Below is the sample dialplan which retrieves the DID form the SIP header and set it as variable and process through trunkinbound context. Add this dialplan along with existing dialplan.
[trunkinbound]
exten => s,1,Noop(Let us look deeper into the soul of the invite)
exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => s,n,Goto(trunkinbound,${pseudodid},1)
Use asterisk 's' extension: This is the final solution if about mentioned methods fails, where we execute or activate the asterisk extension 's'  instead of matching the pattern '_X.' in dialplan.

[trunkinbound]
exten => s,1,AGI(agi-DID_route.agi)

Conclusion

Resolving the extension 's' rejected because extension not found error in Vicidial requires a systematic approach, from basic checks in dial plan configurations to exploring advanced solutions like deriving the SIP header values. By following the outlined troubleshooting steps, you can effectively overcome this error and optimize the performance of your Vicidial call center. For support reach me on skype or telegram id:striker24x7
No Comment
Add Comment
comment url