Esempio n. 1
0
 /** Sends a new message. */
 public void send(
     String recipient, String subject, String content_type, String content, String displayname) {
   NameAddress to_url = new NameAddress(recipient);
   NameAddress from_url = new NameAddress(user_profile.from_url);
   from_url.setDisplayName(displayname);
   MessageFactory msgf = new MessageFactory();
   Message req =
       msgf.createMessageRequest(sip_provider, to_url, from_url, subject, content_type, content);
   TransactionClient t = new TransactionClient(sip_provider, req, this);
   t.request();
 }
Esempio n. 2
0
  /** When a new call is incoming */
  public void onUaCallIncoming(
      UserAgent ua, SessionDescriptor remote_sdp, NameAddress callee, NameAddress caller) {
    printOut("Incoming Call from " + caller.toString());

    String audio_file = callee.getAddress().getParameter(PARAM_RESOURCE);
    if (audio_file != null) if (new File(audio_file).isFile()) user_profile.send_file = audio_file;

    if (user_profile.send_file != null) ua.accept();
    else ua.hangup();

    user_profile.audio_port++;
    ua = new UserAgent(sip_provider, user_profile, this);
    ua.listen();
  }