Rate this page:

callUserDirect

Copy URL
callUserDirect(incomingCall: 

Call

,
username:

string

,
callerid:

string

,
displayName:

string

,
extraHeaders:

{[header: string]: string}

):

Call

Start an outgoing call to the specified Voximplant user in peer-to-peer mode. The JavaScript scenario that uses this method and user being called should be both associated with the same Voximplant application. Audio playback and recording will not make any effect. P2P mode is available only for calls between SDKs. The method can trigger the CallEvents.Failed event in 60 sec, see the details in VoxEngine session limits. IMPORTANT: calling this method makes impossible to use non-P2P mode for a new call and specified incomingCall. So the following methods can't be used: Call.say, Call.sendDigits, Call.sendMediaTo, Call.stopMediaTo.

Parameters

  • incomingCall:

    Call

    Incoming call that needs to be forwarded

  • username:

    string

    Name of the Voximplant user to call

  • callerid:

    string

    CallerID of the caller that will be displayed to the callee. Usage of whitespaces is not allowed. Normally it's some phone number that can be used for callback. IMPORTANT: test numbers rented from Voximplant can't be used as CallerID, use only real numbers.

  • displayName:

    string

    Name of the caller that will be displayed to the callee. Normally it's a human-readable version of CallerID, e.g. a person's name.

  • extraHeaders:

    {[header: string]: string}

    Optional

    Optional custom parameters (SIP headers) that should be passed with a call (INVITE) message. Custom header names have to begin with the 'X-' prefix. The "X-" headers can be handled by a SIP phone or WEB SDK (e.g. see the incomingCall event). Example: {'X-header':'value'}

Returns