Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
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);
            }
        }