Package net.sourceforge.peers

Examples of net.sourceforge.peers.Config


                        notifyListener(sipResponse);
                    } else { // received != via ip address
                        try {
                            InetAddress receivedInetAddress =
                                InetAddress.getByName(received);
                            Config config = userAgent.getConfig();
                            config.setPublicInetAddress(receivedInetAddress);
                            userAgent.getUac().register();
                        } catch (UnknownHostException e) {
                            notifyListener(sipResponse);
                            logger.error(e.getMessage(), e);
                        } catch (SipUriSyntaxException e) {
View Full Code Here


        jLabel6 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Account");

        Config config = userAgent.getConfig();

        String userPart = config.getUserPart();
        if (userPart != null) {
            jTextField1.setText(userPart);
        }

        String domain = config.getDomain();
        if (domain != null) {
            jTextField2.setText(domain);
        }

        String password = config.getPassword();
        if (password != null) {
            jPasswordField1.setText(password);
        }

        SipURI outboundProxy = config.getOutboundProxy();
        if (outboundProxy != null) {
            jTextField4.setText(outboundProxy.toString());
        }

        jLabel1.setText("User");
View Full Code Here

        pack();
    }// </editor-fold>                       

    private void applyNewConfig() {
        Config config = userAgent.getConfig();
        String userpart = jTextField1.getText();
        if (userpart != null) {
            config.setUserPart(userpart);
        }
        String domain = jTextField2.getText();
        if (domain != null) {
            config.setDomain(domain);
        }
        char[] password = jPasswordField1.getPassword();
        if (password != null && password.length > 0) {
            config.setPassword(new String(password));
        }
        String outboundProxy = jTextField4.getText();
        if (outboundProxy != null) {
            SipURI sipURI;
            try {
                if ("".equals(outboundProxy.trim())) {
                    config.setOutboundProxy(null);
                } else {
                    if (!outboundProxy.startsWith(RFC3261.SIP_SCHEME)) {
                        outboundProxy = RFC3261.SIP_SCHEME
                            + RFC3261.SCHEME_SEPARATOR + outboundProxy;
                    }
                    sipURI = new SipURI(outboundProxy);
                    config.setOutboundProxy(sipURI);
                }
            } catch (SipUriSyntaxException e) {
                JOptionPane.showMessageDialog(this, e.getMessage());
                logger.error("sip uri syntax issue", e);
                return;
            }
        }
        config.save();
        unregistering = false;
        if (password != null && password.length > 0) {
            Runnable runnable = new Runnable() {
                public void run() {
                    try {
View Full Code Here

            throws IOException {
        SessionDescription sessionDescription = new SessionDescription();
        sessionDescription.setUsername("user1");
        sessionDescription.setId(random.nextInt(Integer.MAX_VALUE));
        sessionDescription.setVersion(random.nextInt(Integer.MAX_VALUE));
        Config config = userAgent.getConfig();
        InetAddress inetAddress = config.getPublicInetAddress();
        if (inetAddress == null) {
            inetAddress = config.getLocalInetAddress();
        }
        sessionDescription.setIpAddress(inetAddress);
        sessionDescription.setName("-");
        sessionDescription.setAttributes(new Hashtable<String, String>());
        List<Codec> codecs;
        if (offer == null) {
            codecs = supportedCodecs;
        } else {
            codecs = new ArrayList<Codec>();
            for (MediaDescription mediaDescription:
                    offer.getMediaDescriptions()) {
                if (RFC4566.MEDIA_AUDIO.equals(mediaDescription.getType())) {
                    for (Codec codec: mediaDescription.getCodecs()) {
                        if (supportedCodecs.contains(codec)) {
                            codecs.add(codec);
                        }
                    }
                }
            }
        }
        MediaDescription mediaDescription = new MediaDescription();
        Hashtable<String, String> attributes = new Hashtable<String, String>();
        attributes.put(RFC4566.ATTR_SENDRECV, "");
        mediaDescription.setAttributes(attributes);
        mediaDescription.setType(RFC4566.MEDIA_AUDIO);
        mediaDescription.setPort(config.getRtpPort());
        mediaDescription.setCodecs(codecs);
        List<MediaDescription> mediaDescriptions =
            new ArrayList<MediaDescription>();
        mediaDescriptions.add(mediaDescription);
        sessionDescription.setMediaDescriptions(mediaDescriptions);
View Full Code Here

        if (userAgent == null) {
            // if several peers instances are launched concurrently,
            // display error message and exit
            return;
        }
        Config config = userAgent.getConfig();
        if (config.getPassword() != null) {
            userAgent.getUac().register();
        }
    }
View Full Code Here

    @BeforeClass
    protected void init() throws UnknownHostException {
        //TODO interface between transport manager and transaction manager
        final int localPort = PortProvider.getNextPort();
        Config config = new Config() {
           
            @Override public void setUserPart(String userPart) {}
            @Override public void setSipPort(int sipPort) {}
            @Override public void setRtpPort(int rtpPort) {}
            @Override public void setPassword(String password) {}
View Full Code Here

   
    @BeforeTest
    protected void init() throws UnknownHostException {
        port = PortProvider.getNextPort();
        //TODO interface between transport manager and transaction manager
        Config config = new Config() {
           
            @Override public void setUserPart(String userPart) {}
            @Override public void setSipPort(int sipPort) {}
            @Override public void setRtpPort(int rtpPort) {}
            @Override public void setPassword(String password) {}
View Full Code Here

   
    @BeforeClass
    public void init() throws UnknownHostException {
        Logger logger = new Logger(null);
        transactionManager = new TransactionManager(logger);
        Config config = new Config() {
           
            @Override public void setUserPart(String userPart) {}
            @Override public void setSipPort(int sipPort) {}
            @Override public void setRtpPort(int rtpPort) {}
            @Override public void setPassword(String password) {}
View Full Code Here

            inetAddress = InetAddress.getByName("192.168.2.1");
        } catch (UnknownHostException e) {
            e.printStackTrace();
            return;
        }
        Config config = new Config() {
           
            @Override public void setUserPart(String userPart) {}
            @Override public void setSipPort(int sipPort) {}
            @Override public void setRtpPort(int rtpPort) {}
            @Override public void setPassword(String password) {}
View Full Code Here

public class UdpMessageReceiverTestMain implements Runnable {

    public void run() {
        try {
            Config config = new Config() {
               
                @Override public void setUserPart(String userPart) {}
                @Override public void setSipPort(int sipPort) {}
                @Override public void setRtpPort(int rtpPort) {}
                @Override public void setPassword(String password) {}
View Full Code Here

TOP

Related Classes of net.sourceforge.peers.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.