Exemplo n.º 1
0
 public async Task Init(Conversation conversation)
 {
     try
     {
         _call = new InstantMessagingCall(conversation);
         _call.InstantMessagingFlowConfigurationRequested += _call_InstantMessagingFlowConfigurationRequested;
         await _call.EstablishAsync();
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error on init: " + ex.ToString());
     }
 }
Exemplo n.º 2
0
        private async Task SendIM(List <string> messages, string toastMessage, string destinationSip)
        {
            Conversation         conversation = new Conversation(_endpoint);
            InstantMessagingCall call         = new InstantMessagingCall(conversation);

            ToastMessage         toast   = new ToastMessage(toastMessage);
            CallEstablishOptions options = new CallEstablishOptions();

            await call.EstablishAsync(destinationSip, toast, options);

            foreach (var msg in messages)
            {
                await call.Flow.SendInstantMessageAsync(msg);
            }
            await conversation.TerminateAsync();

            Console.WriteLine("IM Sent");
        }
Exemplo n.º 3
0
        private async Task SendIM(List<string> messages, string toastMessage, string destinationSip)
        {

            Conversation conversation = new Conversation(_endpoint);
            InstantMessagingCall call = new InstantMessagingCall(conversation);

            ToastMessage toast = new ToastMessage(toastMessage);
            CallEstablishOptions options = new CallEstablishOptions();

            await call.EstablishAsync(destinationSip, toast, options);
            foreach (var msg in messages)
            {
                await call.Flow.SendInstantMessageAsync(msg);
            }
            await conversation.TerminateAsync();
            Console.WriteLine("IM Sent");
        }