private void buttonPublish_Click(object sender, EventArgs e) { if (this.pubSession == null) { this.pubSession = new PublicationSession(stack); this.pubSession.addHeader("Content-Type", "application/pidf+xml"); this.pubSession.addHeader("Event", "presence"); this.pubSession.setExpires(30); byte[] payload = Encoding.UTF8.GetBytes(PUBLISH_PAYLOAD); this.pubSession.Publish(payload, (uint)payload.Length); } }
public MyPublicationSession(MySipStack sipStack, String toUri) : base(sipStack) { this.session = new PublicationSession(sipStack.WrappedStack); // commons base.init(); // SigComp base.SigCompId = sipStack.SigCompId; // headers this.session.addHeader("Event", "presence"); this.session.addHeader("Content-Type", ContentType.PIDF); this.ToUri = toUri; this.FromUri = toUri; }
public override int OnPublicationEvent(PublicationEvent e) { short code = e.getCode(); tsip_publish_event_type_t type = e.getType(); String text; PublicationSession session = e.getSession(); switch (type) { default: break; } text = String.Format("OnPublicationChanged() ==> {0}:{1}", code, e.getPhrase()); if (this.form.InvokeRequired) { this.form.Invoke(this.form.mydel, new object[] { text }); } return(0); }
private void buttonPublish_Click(object sender, EventArgs e) { if (this.pubSession == null) { this.pubSession = new PublicationSession(stack); this.pubSession.addHeader("Content-Type", "application/pidf+xml"); this.pubSession.addHeader("Event", "presence"); this.pubSession.setExpires(30); byte[] payload = Encoding.UTF8.GetBytes(PUBLISH_PAYLOAD); this.pubSession.Publish(payload, (uint)payload.Length); } }