Asterisk does not tell me the number is out of service area

I created a SIP trunk with my conventional PBX that has a SIP module with RJ45 port, this way my VoIP users can make calls to PSTN numbers. The problem is that when they call a PSTN number that is outside the service area my users receives no message from Asterisk saying that the phone is outside the service area, it just disconnects the link. How can I fix it?

What SIP status code is the PBX generating? More precisely what sequence? Use the sip history CLI commands.

Depending on the answers, you may have to reconfigure the PBX, or use a better one, or you may need to explicitly test the hangup cause variable from Asterisk, or both.

You may have to enable in band progress, at one or both ends (you forgot to say your asterisk version). The PBX may be using a status code, which needs interpreting more specifically, and reporting using in band progress to the phone. Or, of course, the PBX may be incapable of doing either, in which case you need a better PBX.

Actually, if it disconnects, that begs the question as to why it has connected. You may get better call progress by removing any inapproriate calls to Answer(). A premature answer should show in the SIP history, as well.