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; } }
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); } }
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; } }