If you are using CME then you can apply below command in your telephony-service configuration.
auto-answer answer-incoming
If you are using CUCM the it’s not possible you have to select the line to dial the number otherwise it will always use line 1 as primary.
Pls rate if its “Helpful”. If this answered your question pls click on “Accept as Solution”.