Forwarding to PSTN number and then to voice mail

I wish to set up an inbound route to receive calls from a DID number purchased from a DID numbers provider. When the DID number receive a call, first the call should be forwarded to an external destination (either a SIP URI or PSTN number) and, if this doesn’t answer, to the voicemail of FreePBX.

In summary, I wish to know

  1. How to set up the inbound route to an external destination (SIP URI or PSTN)
  2. How to shift the call to the voice mail, if the external destination doesn’t answer
  3. The key point is that, in case the PSTN answers, the cost of the call is billed (by the DID provider) to the leaseholder of the DID number. No payments, no billing should be managed in freePBX. Is this possible?

ASterisk is a “Back to Back User Agent,” as such, you have very limited control over a SIP " INVITE" if you don’t provided “ANSWER” , if you don’t you can’t access any internal endpoints yet if you do, then there is no way you won’t be exposed to ‘billing’

OK, If I have to manage the billing, then I will see how to solve it. I wish to know anyway the limited possibilities that I have. At least with a VOIP destination.

If you answer the call, you have no limitation, asterisk is a B2BUA, if you don’t answer the call you don’t have much control over it.

OK. The question is: how to do it?
There is a plenty of possible destinations for inbound route. E.g call flow control?

Just a gentle reminder.
Can anybody clarify how to forward the incoming call to a PSTN number?

For that did set an inbound route for the DID that points to a virtual extension so associated with your desired destination,

For my understanding, why it is necessary to use a virtual extension? Wouldn’t a pjsip extension be valid too?

In order to forward the call to an external PSTN number I guess that an outbound trunk and/or outbound route are needed, aren’t they? If yes, how should I configure them?

And where should I write the PSTN number? I think that it should be written in the follow-me section, right?

Can someone provide a complete and detailed answer to this post?

It would be but as previously stated, the pjsip extension can handle the call but only if the call is ‘answered’ which also previously stated then there WILL be a payment needed to answer that call and thus send it to voicemail or anywhere else (google B2BUA)

Is an outbound trunk / route needed?

Of course if your required :-

. . . first the call should be forwarded to an external destination  . . .

is to be satisfied. As soon as you do that, the call is considered ‘answered’ by your provider so charges will be applied.,

An outbound route is needed, or an outbound trunk, or both? I would like to know how to configure them.
By the way, if I try to create an outbound route, it requests to me to fill mandatorily a “dial pattern” and I don’t know what to write there.

This is the full log of my last test.

The PSTN didn’t ring and the voicemail was triggered after the timeout.
It says this:
[2022-11-01 21:06:21] VERBOSE[14540][C-00001a4f] pbx.c: Executing [[email protected]:5] Playback("Local/[email protected];2", "silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer") in new stack

Is the PSTN number to be written with or without leading 00?
Anyway, it fails in the same way in both cases.

There is a link to the ‘wiki’ at the top of this page, basic setups are all covered there.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.