I’ve bought a virtual number (DID) to a proveider and I can make call from an analog number to that DID and gets the call to an extension on my PBX which running on Asterisk.
What I want to do is from any extension call to a number a take out the call through the DID. But that is not working.
The second lines is when someone makes a call to that DID, SIP/julian rings and that works fine!
What’s the configuration for your SIP Endpoints? You should add something like below in a context defined in your SIP endpoints.
Assuming the context is from_internal then add below in your extensions.conf
[from_internal]
exten => _X.,1, NoOP(Call from ${CALLERID(num)} to ${EXTEN})
same => n, DIal(SIP/trunk/${EXTEN},60)
type=friend is a security risk and I suggest you properly understand the security mechanism before you setup your Asterisk based system with external connectivity.
I believe you have just started working with Asterisk and I suggest to go through this book (based on old version of Asterisk but still really good to understand Asterisk and its components) and Asterisk wiki