[Sony Xperia XZ1  Guides, News, & Discussion] project_2501:
Same tricks with a bit little bit of a different story to get VoLTE functioning on an AOSP build. First you'll want to read this post to get an idea of how to bundle the XZ1 Compacts Modem and OEM partition .imgs for an XZ1. Please be familiar with the setup of software to flash your device safely and properly ☢️(insert usual disclaimer here for those who are fresh to the procedure)💥.

First step: gather modem_X-FLASH-ALL-C93B.sin & oem_X-FLASH-CUST-C93B.sin from the XZ1 Compact for the US (Customized build, not a carrier specific one; if you want, you can try other builds depending on your region/country or for RX/TX testing). Gather an XZ1 bundle for your model (most recent firmware available).

Second step: delete corresponding modem.sin and oem.sin from the XZ1 build and place the two gathered from the XZ1 Compact into the XZ1 build. Creating seperate folders not nested within the firmware/Downloads/ directory helps keep things organized during the swap. Keep in mind, build versions should be the same as should the Android version.

Third step: bundle and flash the build.

Fourth step: boot the device with the SIM inserted and it will provision the modem with the carriers configuration (if there is one).

Fifth step: dial *#*#4636#*#* and select the active SIM slot change Prefered Network Type to LTE only (note you may have to enable/disable airplane mode to establish a connection).

At this point you should be able to make a call and the Dialer will state the call is in HD. If not, sometimes the Prefered Network Type will revert upon first provisioning, check that it hasn't and if so set it back to LTE only (it may take a minute or two to register with the network).

Once you have confirmed and established VoLTE for calling you can proceed to install an AOSP build.

TWRP is recommended for any build containing Customization Selector and Xperia Parts; boot into recovery and install whichever build you decide.

Sixth step: after flashing your build.zip of choice do not reboot. You'll want to make sure to remove the following two apps before first boot into the newly flashed system. At the main TWRP recovery menu tap Mount and check off System, back at the main menu tap Advanced and tap Terminal, type:

cd /system/system_ext/priv-app

and then type:

rm -Rf CustomizationSelector XperiaParts

*probably not necessary, but do it anyway: go back to the main menu and tap wipe and tap advanced and wipe Dalvik and Cache only.

Seventh Step: boot into the build of your choice and you will notice the System is not resetting upon SIM detection on first boot. Once you are finished with initial setup return to the Testing/Phone Info/Network Configuration app ( *#*#4636#*#* ) and set your Prefered Network Type back to LTE (again, you may have to enable/disable airplane mode to establish a connection). From boot it is normal for a brief network connection to disconnect and re-establish after a minute, at which point it doesn't disconnect again unless there are other network issues in the area.

Caution: for those who have more than one device or SIM slot and switch their sim card from one to the other. Once carrier provisioning is triggered again for another IMEI the configuration will not be able to be provisioned again with the XZ1 AOSP build (until @derf elot or whomever the dev is that authored the apps removed fixes how the modem is provisioned and which configs it has to choose from). Erasing oem and modem via fastboot and reverting back to the stock build (without the partition swap) followed by the above is the only way to return it back to a functional state with the carrrier for AOSP.