Esempio n. 1
0
    public override void handleCommand(CommandString command)
    {
        switch (command.getOp())
        {
        case "incoming_available": {
            callId = command.get("destination_id");
            Console.WriteLine("Incoming call!: " + callId);
            CommandString cmd = new CommandString(callId, SipCommandString.accept_invite, "");
            sendCommand("sip", cmd);
            break;
        }

        case "remote_cancelled_invite":
            Console.WriteLine("Missed call!");
            break;

        case "invite_ok": {
            CommandString cmd = new CommandString(callId, MediaCommandString.set_session_sound_settings, "senders", "ON");
            sendCommand("media", cmd);

            Console.WriteLine("Activated media");
            break;
        }

        case "remote_hang_up":
            Console.WriteLine("Hangup");
            break;

        default:
            Console.WriteLine("My handleCommand: " + command.getString());
            break;
        }
    }
Esempio n. 2
0
 public override void run()
 {
     for (;;)
     {
         //Console.WriteLine("Before waitCommand");
         CommandString cmd = waitCommand();
         //Console.WriteLine("After waitCommand");
         if (cmd.getOp() == "stop")
         {
             //Console.Writ	eLine("Return thread");
             return;
         }
         handleCommand(cmd);
     }
 }
Esempio n. 3
0
    public override void handleCommand(CommandString command)
    {
        switch( command.getOp() ){
        case "incoming_available": {
          callId = command.get("destination_id");
          Console.WriteLine("Incoming call!: " + callId);
          CommandString cmd = new CommandString(callId, SipCommandString.accept_invite, "");
          sendCommand("sip", cmd);
          break;
        }
        case "remote_cancelled_invite":
          Console.WriteLine("Missed call!");
          break;
        case "invite_ok": {
          CommandString cmd = new CommandString(callId, MediaCommandString.set_session_sound_settings, "senders", "ON");
          sendCommand("media", cmd);

          Console.WriteLine("Activated media");
          break;
        }
        case "remote_hang_up":
          Console.WriteLine("Hangup");
          break;
        default:
          Console.WriteLine("My handleCommand: " + command.getString());
          break;
        }
    }