We consider an infinite-capacity M/M/c retrial queue with second optional service (SOS) channel. An arriving customer finds a free server would enter the service (namely, the first essential service, denoted by FES) immediately; otherwise, the customer enters into an orbit and starts generating requests for service in an exponentially distributed time interval until he finds a free server and begins receiving service. After the completion of FES, only some of them receive SOS. The retrial system is modelled by a quasi-birth-and-death process and some system performance measures are derived. The useful formulae for computing the rate matrix and stationary probabilities are derived by means of a matrix-analytic approach. A cost model is derived to determine the optimal values of the number of servers and the two different service rates simultaneously at the minimal total expected cost per unit time. Illustrative numerical examples demonstrate the optimisation approach as well as the effect of various parameters on system performance measures.