The application provides a method and an electronic device for realizing computer telephone integration, which comprises the following steps: establishing a media-free INVITE request by injecting a media negotiation skip flag in an INVITE session creation interface and filling a
system state query
XML document of a CTI
protocol specification in an INVITE request body, wherein the media-free INVITE request does not carry an SDP media description;
multiplexing the media-free INVITE request as the first step of a CTI
handshake step, using a SIP session established by the media-free INVITE request as a CTI persistent
control channel, and transmitting a CTI control instruction encoded by a CSTA
XML in the SIP session through a SIP INFO method. By using the technical scheme, a persistent CTI
control channel independent of a media
stream can be established in a SIP protocol framework, complete decoupling of a control plane and a media plane is realized, and media resource overhead required for maintaining CTI monitoring in a no-call
scenario is completely eliminated.