So it calls extension 301 then when that extension answers, it dials the Exten number for example 02081231234. However, extension 301 requires a pin to dial to number matching that pattern. Is it possible to use comma followed by pin and # as the Exten value for example below:
So I asked AI about this and it suggested the following solution. Given how inaccurate AI can be sometimes, can someone check this and tell me if it sounds ok and if it will work? specially syntaxes and commands for FreePBX 17
Edit the extensions_custom.conf file to create a new custom context as follows: nano /etc/asterisk/extensions_custom.conf
Reload the dialplan: asterisk -rx "dialplan reload"
Verify the Custom Context asterisk -rx "dialplan show clicktocall-pin"
User variable in AMI Variable: number=$number,pin=$pin
How It Works:
Normal Call: Uses from-internal context and Directly dials the number
PIN Call (when conditions are met):
Uses clicktocall-pin context
Passes number and pin as variables
Custom dialplan waits 2 seconds (wwww) after remote party answers
Sends PIN followed by # as DTMF tones
Means you can’t select the latest Asterisk, but you must either select a legacy version, or obtain a chan_sip from a forked project. (If you want an extension, in the Asterisk sense, you should use Local/301@from-internal.
, and # would be sent to your SIP provider, who would probably fault them, but would be permitted to interpret them in the way you wanted. It is probably only analogue FXO gateways that might, normally, be expected to understand this format.
Actually the easiest way of doing this is to completely bypass FreePBX, and call the custom context direct from the originate. In that case, it would probably be easier to read if you replaced s by _X., and DIALSTRING by EXTEN.
It would also be possible to parse the exact string, but you seem to be using UK numbers, so you would need patterns for each possible number length - not all UK numbers are the same length.