Set variable by device in sip.conf

When I manually create a sip.conf I can add a variable by user/device like so:
setvar = variable=value

But in FreePBX I don’t see a spot where I can add that. Is it possible?

Settings -> Asterisk SIP Settings -> Chan SIP Settings -> Other SIP Settings

It’s the last option at the bottom of the page.

That sets a variable for the entire system (in SIP) - I want it by user/device. For example, if I edit sip.conf and go to the context [123] I can add setvar = favcolor=blue, then in context [124] setvar = favcolor=red, etc. I would I do this in FreePBX?

In the file /etc/asterisk/sip_custom_post.conf add lines like this:

[2002](+)
setvar=nonsense=test1

Then test at the Asterisk CLI do “sip reload” then “sip show peer 2002”, towards the bottom you will see the variables section. Substitute whatever extension you want in place of the 2002.