How to customize ring group

freepbx ver 2.8
asterisk 1.6
piaf ver 1.7 64bit

without delving into a lot of details on why this needs to be achieved, i am looking for suggestions and perhaps some working code sample of testing the following in frepbx without breaking it

have a ring group already present in freepbx which works
everytime the call enters the ring group, need to call a url, with the originating extension passed to the url as a variable and allow the ring group code to continue as dictated by freepbx developers

url sample is:
http://myserver.local/doaction.php?origexten={asterisk-variable}

i would like to know what the code should look like and where it should go in freepbx config files without getting over written by freepbx upon reloads and such
any idea, suggestions are appreciated.

i am no asterisk coder, but i can read code and understand without too much trouble.

thanks for ideas and suggestions.

This MIGHT work - no guarantees, but it may get you pointed in the right direction.

Add two lines in /etc/asterisk/extensions_custom.conf under the existing [from-internal-custom] context (this context should already exist in the file, just add this at the bottom):

exten => 00000,1,TrySystem(wget -b -O /dev/null -o /dev/null “http://myserver.local/doaction.php?origexten=${asterisk-variable}”)
exten => 00000,n,Busy

Note that if there are any “special” characters in the URL you may need to use the hexadecimal equivalents (such as %20 instead of a space). You may also need to URIENCODE your Asterisk variable if there is any possibility it could contain special characters, such as ${URIENCODE(${asterisk-variable})}

Then just add extension 00000# (you probably will need the # suffix) to your ring group. You can give the “dummy” extension any number you want as long as it doesn’t conflict with something else on your system. Register your “dummy” extension using the “Custom Extensions” module (under the Tools menu) to avoid any possibility of a conflict.

Hope this helps.

sir_sip:

this looks like it could work.

is it possible that I can make this code into a macro, and call this macro from the ring-group code section perhaps, and upon completion, execution returns back to the calling macro without breaking the ring-group code sequence?