Notifying Callers of Unsuccessful Payments in FreePBX: Seeking Solutions

We’re currently in the midst of establishing a VoIP phone company and are exploring the possibility of integrating Stripe for payment processing. Our goal is to implement a system that can notify callers of unsuccessful payments with a message instructing them to visit our website for payment (using “nopayment.wav”), followed by a hangup. Additionally, we intend to temporarily disable all incoming calls with a message stating “your call was unsuccessful” (using “nocall.wav”) if an invoice remains unpaid. On the other hand, if the payment is successfully processed, we will enable normal call operations.

This all seems possible with FreePBX. In my opinion the main mechanism besides the required APIs and or Scripts would be using Dynamic Routing, which enables dynamic routing.

Dynamic Routes Module - PBX GUI - Documentation (freepbx.org)

Thank you, will look in to that

1 Like

Thanks for the suggestion, I can’t seem to make it work using dynamic routes, do you have any ideas on using API?

No, what you have provided is too abstract. What API? Dynamic routes would facilitate:

  1. Caller comes to inbound route
  2. Inbound route points to dynamic route
  3. Run your AGI script that returns what to do with the caller according to a value (Result1=XRoute, Result2=YRoute,…)
  4. Build out the dynamic route destinations to the appropriate announcements
  5. Build out the announcement destinations to the appropriate destinations (Hangup, queue, extension, etc.)

You would need to develop the AGI script that facilitates the routing information. It’s Linux so you could use any combination of scripting language and APIs to accomplish this lookup.

Another more manual way is to maintain the allowlist module in a way that could accommodate what you are looking to do. Allowlist lets you create an allowed list of numbers to continue on and any number not on the list can be sent to a chosen destination. I do not see a GraphQL API for managing the allowlist, but you could likely come up with a method to update the MySQL table that hosts the list and reload dial plan. That would help automate the management of the list. At that point your back to the same level of effort as the dynamic route. six of one…

Maybe add to the astdb externally when the user using {1234} goes into arrears

rasterisk -x 'database put AMPUSER/1234 inarrears  yes'

\when they payup

rasterisk -x 'database del AMPUSER/1234 inarrears '

Then for outgoiing calls you can query that value, for incoming calls you can compare query that value and conditionally handle both situation

1 Like

Are there any middleware options available to do this?

Consider yourself a middleman :slight_smile:

1 Like

Not that I am aware of, but you are in the right place to get ahold of FreePBX/Asterisk developers in the JOBS section of the fourm if you are thinking you need help.

Thank you

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