I’d appreciate a bit of help in determining where to insert a small customization into my dialplan which sets a VarSet (called SCREENPOP) which I can query remotely via AMI.
I simply want to write the inbound callerID (name & number) and extension number to VarSet and I believe the following would work:
I really only need this for one of my inbound routes, which routes external calls to a specific number through to a specific extension (in my case, ext 201).
Where would be the best place to insert this custom fragment and how do I ensure it won’t be overwritten by FreePBX?
The SCREENPOP variable is being written as it should and the call is then being passed to the ring group. The only trouble is I need to be able to pass a valid ‘channel’ to AMI Getvar in order to successfully return the caller ID info otherwise the value of SCREENPOP is reported as null
The trouble is I don’t know what the channel ‘name’ is at this stage. Do you have any suggestions as to how I might do this?
Thanks again for your help, I really do appreciate it.
I understand that ${CHANNEL} gives the current channel name, but if I use something like Exten => s,1,Set(MyVar=${CHANNEL}), the current channel name is indeed written to MyVar… but, it’s written as a channel variable and unless I pass the correct channel name with the AMI action Getvar, I cannot successfully return the value of MyVar. The trouble is I do not know the channel name to pass at this time.
Is there anyway I can set MyVar as a global variable which I can access without knowing the channel name?