示例#1
0
        public bool Prepare()
        {
            if (this.prepared)
            {
                LOG.Debug("XCAP service already prepared");
                return(true);
            }

            String impu = this.configurationService.Get(
                Configuration.ConfFolder.IDENTITY, Configuration.ConfEntry.IMPU, Configuration.DEFAULT_IDENTITY_IMPU);
            String xcap_ui = this.configurationService.Get(
                Configuration.ConfFolder.XCAP, Configuration.ConfEntry.USERNAME, impu);
            String xcap_root = this.configurationService.Get(
                Configuration.ConfFolder.XCAP, Configuration.ConfEntry.XCAP_ROOT, Configuration.DEFAULT_XCAP_ROOT);
            String xcap_password = this.configurationService.Get(
                Configuration.ConfFolder.XCAP, Configuration.ConfEntry.PASSWORD, Configuration.DEFAULT_XCAP_ROOT);
            int xcap_timeout = this.configurationService.Get(
                Configuration.ConfFolder.XCAP, Configuration.ConfEntry.TIMEOUT, Configuration.DEFAULT_XCAP_TIMEOUT);

            if (this.xcapStack == null)
            {
                this.xcapStack    = new MyXcapStack(this.callback, xcap_ui, xcap_password, xcap_root, xcap_timeout);
                this.xcapSelector = new XcapSelector(this.xcapStack.Stack);
            }
            else
            {
                // update configuration
                if (!this.xcapStack.Configure(xcap_ui, xcap_password, xcap_root, xcap_timeout))
                {
                    LOG.Error("Failed to configure the XCAP stack");
                    return(false);
                }
            }

            if ((this.prepared = this.xcapStack.Start()))
            {
                this.xcapStack.AddHeader("Connection", "Keep-Alive");
                this.xcapStack.AddHeader("User-Agent", "XDM-client/OMA1.1");
                this.xcapStack.AddHeader("X-3GPP-Intended-Identity", this.xcapStack.XUI);
            }
            else
            {
                LOG.Error("Failed to start XCAP Stack");
            }

            return(this.prepared);
        }
示例#2
0
        static void Main(string[] args)
        {
            xcapStack    = new MyXcapStack(new MyXcapCallback(), String.Format("sip:{0}@{1}", USER, REALM), PASSWORD, String.Format("http://{0}:{1}/services", HOST, PORT));
            xcapSelector = new XcapSelector(xcapStack);

            if (!xcapStack.start())
            {
                Console.WriteLine("Failed to start the XCAP stack");
            }

            xcapStack.addHeader("Connection", "Keep-Alive");
            xcapStack.addHeader("User-Agent", "XDM-client/OMA1.1");
            xcapStack.addHeader("X-3GPP-Intended-Identity", String.Format("sip:{0}@{1}", USER, REALM));

            //xcapSelector.setAUID("resource-lists").
            //    setAttribute("list", "name", "rcs").
            //    setAttribute("entry", "uri", String.Format("sip:{0}@{1}", USER, REALM)).
            //    setName("display-name");

            //xcapSelector.setAUID("xcap-caps");
            // xcapStack.getDocument(xcapSelector.getString());
            // xcapSelector.reset();
            // Console.ReadLine();

            xcapSelector.setAUID("resource-lists");
            xcapStack.getDocument(xcapSelector.getString());
            xcapSelector.reset();
            Console.ReadLine();

            xcapStack.stop();

            Console.ReadLine();

            xcapStack.start();

            xcapSelector.setAUID("xcap-caps");
            xcapStack.getDocument(xcapSelector.getString());
            xcapSelector.reset();
            Console.ReadLine();

            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            xcapStack = new MyXcapStack(new MyXcapCallback(), String.Format("sip:{0}@{1}", USER, REALM), PASSWORD, String.Format("http://{0}:{1}/services", HOST, PORT));
            xcapSelector = new XcapSelector(xcapStack);

            if (!xcapStack.start())
            {
                Console.WriteLine("Failed to start the XCAP stack");
            }

            xcapStack.addHeader("Connection", "Keep-Alive");
		    xcapStack.addHeader("User-Agent", "XDM-client/OMA1.1");
            xcapStack.addHeader("X-3GPP-Intended-Identity", String.Format("sip:{0}@{1}", USER, REALM));

            //xcapSelector.setAUID("resource-lists").
            //    setAttribute("list", "name", "rcs").
            //    setAttribute("entry", "uri", String.Format("sip:{0}@{1}", USER, REALM)).
            //    setName("display-name");

            //xcapSelector.setAUID("xcap-caps");
           // xcapStack.getDocument(xcapSelector.getString());
           // xcapSelector.reset();
           // Console.ReadLine();

            xcapSelector.setAUID("resource-lists");
            xcapStack.getDocument(xcapSelector.getString());
            xcapSelector.reset();
            Console.ReadLine();

            xcapStack.stop();

            Console.ReadLine();
            
            xcapStack.start();

            xcapSelector.setAUID("xcap-caps");
            xcapStack.getDocument(xcapSelector.getString());
            xcapSelector.reset();
            Console.ReadLine();

            Console.ReadLine();
        }