I’ve just hooked up an freepbx 2.5.1.1 system up to an old definity G3 V6 system, and incoming and outgoing calls are working fine. The asterisk system has 3 IAX2 trunks to other asterisk boxes, all which work just fine by sending 4 digit extension codes. What I’m trying to get working is to have the definity send a 4 digit code, asterisk passes it out the IAX trunks appropriately.
Unfortunately, for reasons beyond my ability to understand, whenever the definity sends any code less than 7 digits, it appends a # to the end of the code. So when a user dials 4567, asterisk receives 4567#.
Is there a way to have asterisk remove the # at the end of the pattern? I know using a | removes digits from the beginning of the pattern.
My current pattern is XXXX#
I’d like it to replace that pattern with XXXX
Then in your trunk configuration (the trunk that the G3 calls come in on) change context=from-trunk to context=custom-strip-pound. If my code is correct, it should pass only the first four characters of calls coming in as XXXX# (and leave any other pattern unchanged) to from-trunk.
Note you could do something similar on the outgoing side - route your calls to a custom trunk that jumps to a custom context that strips the #, then sends the call back to outbound-allroutes - but it’s probably a lot easier to catch it on the incoming call to the FreePBX box and nip the problem in the bud there, so to speak.