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 void sendInvite(string uri)
    {
        CommandString invite = new CommandString("", SipCommandString.invite, uri);
        CommandString resp   = getCallback().handleCommandResp("sip", invite);

        Console.WriteLine("Calling: " + resp.getString());
        callId = resp.get("destination_id");
    }
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;
        }
    }