How to configure Asterisk `menuselect` build options through commandline

If we are automating installation of Asterisk through a shell script or cmake and we want to enable and disable features in Asterisk, we can use the below option. Normally we use

make menuconfig

which gives us a console based gui and selects features, this can be done without the menuconfig gui.

This is the command line option for menuconfig

make menuselect.makeopts
menuselect/menuselect --enable chan_sip menuselect.makeopts