Table of Contents
reconnect()
call.reconnect() hangs up current call and makes a new call to the same partner again.
Most of the times that partner must then accept the new call for the reconnect to succeed - except in group calls there the new call will be automatically answered if the remote partner uses a wrtc_kit based client. Therefore you should only use call.reconnect() in group calls to wrtc_kit based clients (see example below).
As call.reconnect() needs other end to be wrtc_kit based and in group call for auto answer you should prefer using call.recall() instead.
Arguments
None.
Returns
Nothing.
reconnect() vs recall()
reconnect() hangs up current call and makes a new one.
recall() makes other end call us again using blind transfer.
Both methods have its pros and cons:
reconnect() is a more "straight forward" handling but results in most cases in other end of call must manually accept call again. Only in group calls to a wrtc_kit based client does it answer it automatically.
recall() works in more scenarios, including single calls and calls to SIP clients, and can reinitiate call seamlessly (no need for manual accept of new call as client at this end will automatically accept the new blind transfer call). But as call objects are destroyed and new ones are created it may result in more complex animations on user's screen. And for recall() to work the client at other end must support blind transfer.
Thus there is no solution that can reinitiate a call in 100% of scenarios. Our recommendation is to use recall() - except if you know that you are in a group call with wrtc_kit clients or other end does not support blind transfer.
Example
To make sure you use reconnect() only in group calls to wrtc_kit clients use:
if (call.is("inGroupCall") && call.is("remoteWrtc"))
call.reconnect();
else
call.recall();