Extension with operation codes

Hi,

I want to create an internal number with dynamic operation code, separated by # or (*) (like 101*X or 101#X) where X is number between 1-9. When dialing it must forward call to 101, and depending on X number I want to execute an external script as input parameter (e.g. phone number is 101#5 ‘my_script.php 5’). Is there any way to configure this scenario?

Thanks

What have you tried and what was displayed on the console?