While on a call branch 2 phone 1 user want to transfer the call to voicemail by dialing *XXXX .
how to do this ?
Dialing is usually evaluated and handled in CUCM or CME. Based on your what you've stated; here is one example of what might be required to perform a 4 digit transfer to voicemail from a remote location, hope this helps.
ephone-dn 85 number *.... call-forward all 918085551234 ephone-dn 86 to 89 translation-profile outgoing DirectXferToVoicemail voice translation-rule 6 rule 1 /^*/ /907555/ voice translation-profile DirectXferToVoicemail translate redirect-called 6