Remember writing a call is the same as being short a call, aka, selling-to-open. The correct method to cancel the obligation is to buy-to-close that same contract on the open market.
Most brokers offer a drop-down list in the order entry tab, just select buy-to-close instead of sell-to-open. From Investopedia - Definition of 'Buy To Close'
The closing of a short position in option transactions. Buying to
close involves taking an opposing position from the short position
which is no longer desirable, in order to synthetically close out
exposure to the position. The new long position's performance should
net out with the short position's. It's a strategy used by many
brokerages.
Investopedia explains 'Buy To Close'
Investors can buy to close either puts or calls, or a combination of
the two, and thus will be relinquishing obligations associated with
the option(s). The distinguishing factor of a buy to close is that the
option position must have been held short in the account during the
transaction. This is a common practice as it is not uncommon for
option positions to be closed prior to maturity.