newInvite method
void
newInvite(})
Creates an invitation to send to a destinationNumber
or SIP Destination
using the provided callerName
, callerNumber
and a clientState
Implementation
void newInvite(String callerName, String callerNumber,
String destinationNumber, String clientState,
{Map<String, String> customHeaders = const {}}) {
sessionCallerName = callerName;
sessionCallerNumber = callerNumber;
sessionDestinationNumber = destinationNumber;
sessionClientState = clientState;
customHeaders = customHeaders;
callId = const Uuid().v4();
var base64State = base64.encode(utf8.encode(clientState));
peerConnection = Peer(_txSocket);
peerConnection?.invite(callerName, callerNumber, destinationNumber,
base64State, callId!, _sessid, customHeaders);
//play ringback
playAudio(ringBackFile);
}