Remove suffix from outbound number

Hey all, to keep a long story short, the program our lab uses to initiate outbound calls automatically adds a suffix onto the end of the dialed number. In upgrading to FreePBX, the logic that stripped this suffix off has broken and, being an Asterisk noob, I cannot figure out how to get it working again.

Our calls are initiated looking like 1234567890*1234 and I need to remove the *1234. I have a macro in extensions_custom.conf that does this portion, and that works correctly, however when it returns the cleaned number, I don’t know how to send this to actually be dialed. I didn’t know if there is a simpler way to do this in FreePBX or if there is something built-in for this particular problem.

As you already have custom code, one solution would be to put devices that can source these numbers in a custom context, and once you have the cleaned up number, GoTo (from-internal,${CleanedUp},1)

from-internal is the standard context, which I might have got wrong.

I started working on adding a suffix field to the outbound routes, but never finished it.

In the dialplan it would look like this

exten => _645NXXNXXXXXX777,n,Gosub(sub-send-obroute-email,s,1(1${EXTEN:3},${EXTEN},,${NOW},${CALLERID(name)},${CALLERID(number)}))
exten => _645NXXNXXXXXX777,n,Macro(dialout-trunk,1,1${EXTEN:3:-3},,off)

exten => _645NXXNXXXXXX,n,Gosub(sub-send-obroute-email,s,1(1${EXTEN:3},${EXTEN},,${NOW},${CALLERID(name)},${CALLERID(number)}))
exten => _645NXXNXXXXXX,n,Macro(dialout-trunk,1,1${EXTEN:3},,off)

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