亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? messengermanager.java

?? It is Java for SIP phone
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * MessengerManager.java * * Created on November 25, 2003, 9:14 AM */package gov.nist.applet.phone.ua;import javax.sip.TransactionUnavailableException;import javax.sip.InvalidArgumentException;import javax.sip.ClientTransaction;import javax.sip.ServerTransaction;import javax.sip.SipException;import javax.sip.ListeningPoint;import javax.sip.header.CallInfoHeader;import javax.sip.header.Header;import javax.sip.header.FromHeader;import javax.sip.header.ViaHeader;import javax.sip.header.MaxForwardsHeader;import javax.sip.header.ExpiresHeader;import javax.sip.header.ToHeader;import javax.sip.header.CSeqHeader;import javax.sip.header.ContactHeader;import javax.sip.header.CallIdHeader;import javax.sip.header.ContentTypeHeader;import javax.sip.address.Address;import javax.sip.address.SipURI;import javax.sip.message.Request;import javax.sip.message.Response;import javax.sip.header.AcceptHeader;import javax.sdp.SdpFactory;import javax.sdp.SessionDescription;import javax.sdp.Version;import javax.sdp.Origin;import javax.sdp.Time;import javax.sdp.Connection;import javax.sdp.SessionName;import javax.sdp.MediaDescription;import javax.sdp.SdpException;import java.text.ParseException;import java.util.ArrayList;import java.util.Enumeration;import java.util.Vector;import gov.nist.applet.phone.media.MediaManager;import gov.nist.applet.phone.media.messaging.VoiceRecorder;import gov.nist.applet.phone.ua.call.AudioCall;import gov.nist.applet.phone.ua.call.Call;import gov.nist.applet.phone.ua.call.CallManager;import gov.nist.applet.phone.ua.call.IMCall;import gov.nist.applet.phone.ua.pidf.parser.AddressTag;import gov.nist.applet.phone.ua.pidf.parser.AtomTag;import gov.nist.applet.phone.ua.pidf.parser.MSNSubStatusTag;import gov.nist.applet.phone.ua.pidf.parser.PresenceTag;import gov.nist.applet.phone.ua.presence.PresentityManager;import gov.nist.applet.phone.ua.presence.Subscriber;import gov.nist.applet.phone.ua.gui.NISTMessengerGUI;/** * This class will manage all the calls and their status, and the subscriptions * to the presence. * This application has been designed in following the MVC design pattern. * Thus this class is part of the Model. * * @author  DERUELLE Jean */public class MessengerManager extends java.util.Observable {    private MessageListener messageListener = null;    protected CallManager callManager = null;    private PresentityManager presentityManager = null;    protected RegisterStatus registerStatus = null;    private SipURI userSipURI = null;    private Vector contactList = null;    protected boolean presenceAllowed = false;    private NISTMessengerGUI appletHandle;    protected boolean reRegisterFlag = false;        /** Creates a new instance of CallManager     * @param sipURI - the sipURI of the user     */    public MessengerManager(    Configuration configuration,    NISTMessengerGUI appletHandle) {        MediaManager.detectSupportedCodecs();        contactList = new Vector();        callManager = new CallManager();        //Create a new instance of the sip Listener        messageListener =        new MessageListener(this, configuration, appletHandle);        messageListener.start();                presentityManager = new PresentityManager(this);        //Set the registration status to Not registered        registerStatus = new RegisterStatus();        String userURI = messageListener.getConfiguration().userURI;        try {            //Create the SIP URI for the user URI            String user = userURI.substring(0, userURI.indexOf("@"));            String host =            userURI.substring(userURI.indexOf("@") + 1, userURI.length());            userSipURI =            MessageListener.addressFactory.createSipURI(user, host);            //userSipURI .setTransportParam(messageListener.getConfiguration().signalingTransport);        } catch (ParseException ex) {            System.out.println(userURI + " is not a legal SIP uri! " + ex);        }    }        /**     * Call the user specified in parameter     * @param contactURI - the user to call     */    public void call(String contactURI) {        if(!callManager.isAlreadyInAudioCall()){            //Create a new Call            AudioCall call = new AudioCall(messageListener);            //Store the callee in the call            contactURI = contactURI.trim();            call.setCallee(contactURI);            if (messageListener            .getConfiguration()            .mediaTransport            .equalsIgnoreCase("tcp"))                call.setVoiceMesaging(true);            callManager.addAudioCall(call);            String sdpBody = null;            if (!call.getVoiceMessaging())                sdpBody = createSDPBody(call.getMediaManager().getAudioPort());            sendInvite(contactURI, sdpBody);        }    }        /**     * Answer the call, i.e. answer ok to an incoming invite     * after have found the good media session     */    public void answerCall(String caller) {        //Find the Audio call        AudioCall call = callManager.findAudioCall(caller);        //Get the request        Request request = call.getDialog().getFirstTransaction().getRequest();        //Getting the media Manager for this call        MediaManager mediaManager = call.getMediaManager();        //Getting the sdp body for creating the response        //This sdp body will present what codec has been chosen        //and on which port every media will be received        Object responseSdpBody = null;        if (!call.getVoiceMessaging()) {            ContentTypeHeader contentTypeHeader =            (ContentTypeHeader) request.getHeader(ContentTypeHeader.NAME);            String contentType = contentTypeHeader.getContentType();            String subType = contentTypeHeader.getContentSubType();            System.out.println("the other end invite us to " + subType);                        if (contentType.equals("application") && subType.equals("sdp")) {                //Get the Sdp Body                String content = new String(request.getRawContent());                responseSdpBody = mediaManager.getResponseSdpBody(content);            }        }        sendOK(responseSdpBody, caller);    }        /**     * Cancel the current call     */    public void cancelCall(String calleeURI) {        //Find the Audio call        AudioCall call = callManager.findAudioCall(calleeURI);        Request request = call.getDialog().getFirstTransaction().getRequest();        if (call.getDialog().isServer()) {            System.out.println("Cannot cancel a server transaction");                    }        ClientTransaction clientTransaction =        (ClientTransaction) call.getDialog().getFirstTransaction();        try {            if (call.getDialog().getState() == javax.sip.DialogState.EARLY ||                call.getDialog().getState() == null) {                Request cancel = clientTransaction.createCancel();                ClientTransaction cancelTransaction =                messageListener.sipProvider.getNewClientTransaction(cancel);                cancelTransaction.sendRequest();            } else System.out.println("Too late to cancel -- send BYE instead!");        } catch (SipException ex) {            System.out.println("Failed to send the CANCEL request " + ex);        }    }        /**     * End the current call     */    public void endCall(String calleeURI) {        //Find the Audio call        AudioCall call = callManager.findAudioCall(calleeURI);	if (call == null) {		System.out.println("Call not found " +  calleeURI );		return;	}        //Request        Request request = null;        try {            request = call.getDialog().createRequest("BYE");        } catch (SipException ex) {            System.out.println("Could not create the bye request! " + ex);        }        //Transaction        ClientTransaction clientTransaction = null;        try {            clientTransaction =            messageListener.sipProvider.getNewClientTransaction(request);            System.out.println(request.toString());            call.getDialog().sendRequest(clientTransaction);                    } catch (TransactionUnavailableException ex) {            System.out.println(            "Could not create a register transaction!\n"            + "Check that the Registrar address is correct!"            + " "            + ex);        } catch (SipException ex) {            System.out.println(            "Could not send out the register request! " + ex);        }        if (call.getVoiceMessaging()) {            //Stop the voice messages schedule and the voiceRecorder            messageListener.messageProcessor.stopVoiceMessagingSchedule();        } else {            call.getMediaManager().stopMediaSession();        }    }        /**     * Add a contact to our contact list     * @param contact - contact to add     */    public void addContact(String contact) {        if (isInContactList(contact))            System.out.println(            "The contact is already in our contact list,"            + "he's not going to be added");        else            contactList.addElement(contact);    }        /**     * Remove a contact to our contact list     * @param contact - contact to remove     */    public void removeContact(String contact) {        if (isInContactList(contact))            contactList.remove(contact);        else            System.out.println(            "The contact is not in our contact list,"            + "he can not going to be removed");    }        /**     * Check if the contact is in the contact List     * @param contactAddress - the contact     * @return true if the contact is in the contact List     */    protected boolean isInContactList(String contactAddress) {        Enumeration e = contactList.elements();        while (e.hasMoreElements()) {            if (((String) e.nextElement()).equals(contactAddress))                return true;        }        return false;    }        /**     * Stop an opened instantMessaging Session     * @param calleeURI - sip address of the person the application is chatting with     */    public void stopInstantMessagingSession(String calleeURI) {        calleeURI = calleeURI.trim();        IMCall call = callManager.findIMCall(calleeURI);        //If no instant messaging session exists        if (call == null)            return;        Request bye = null;        try {            bye = call.getDialog().createRequest("BYE");        } catch (SipException se) {            se.printStackTrace();        }        //Transaction        ClientTransaction clientTransaction = null;        try {            clientTransaction =            messageListener.sipProvider.getNewClientTransaction(bye);        } catch (TransactionUnavailableException ex) {            System.out.println("Could not create a bye transaction!\n" + ex);        }        System.out.println(bye.toString());        try {            call.getDialog().sendRequest(clientTransaction);        } catch (SipException ex) {            System.out.println("Could not send out the bye request! " + ex);        }    }        /**     *     * @param requestName     * @param callee     * @return     */    protected Request createRequest(    String requestName,    SipURI callee,    SipURI caller) {        //Listening Point        ListeningPoint listeningPoint =        messageListener.sipProvider.getListeningPoint();        //Request URI        SipURI requestURI = null;        try {            requestURI = callee;            requestURI.setTransportParam(            messageListener.getConfiguration().signalingTransport);            //Call ID            CallIdHeader callIdHeader =            messageListener.sipProvider.getNewCallId();            //CSeq            CSeqHeader cSeqHeader =            MessageListener.headerFactory.createCSeqHeader(1, requestName);            //From Header            Address fromAddress =            MessageListener.addressFactory.createAddress(            MessageListener.addressFactory.createSipURI(            caller.getUser(),            caller.getHost()));            FromHeader fromHeader =            MessageListener.headerFactory.createFromHeader(            fromAddress,            generateTag());            //ToHeader            Address toAddress =            MessageListener.addressFactory.createAddress(            MessageListener.addressFactory.createSipURI(            callee.getUser(),            callee.getHost()));            // From and To are logical identifiers (should have no parameters)            ToHeader toHeader =            MessageListener.headerFactory.createToHeader(toAddress, null);            //ViaHeader            ArrayList viaHeaders = new ArrayList();            ViaHeader viaHeader =            MessageListener.headerFactory.createViaHeader(

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
8x福利精品第一导航| 一本久道久久综合中文字幕| 欧美v日韩v国产v| 久久精品国产色蜜蜜麻豆| 日韩欧美国产一区二区在线播放 | 在线播放视频一区| 久久国产精品无码网站| 久久久久久久久久久久久夜| 波多野结衣的一区二区三区| 亚洲色图制服丝袜| 88在线观看91蜜桃国自产| 狠狠网亚洲精品| 国产精品麻豆久久久| 在线观看国产精品网站| 奇米综合一区二区三区精品视频| 亚洲精品在线网站| 色综合视频一区二区三区高清| 亚洲一区二区三区中文字幕 | 欧美一区二区三区免费视频| 精品一区二区免费视频| 国产精品拍天天在线| 国产麻豆9l精品三级站| www.欧美亚洲| 亚洲伊人伊色伊影伊综合网| 在线播放中文字幕一区| 成人中文字幕电影| 亚洲国产wwwccc36天堂| 久久久精品国产免大香伊| 一本色道a无线码一区v| 久久精品国产免费| 亚洲精品免费在线观看| 2023国产一二三区日本精品2022| 91网站最新地址| 麻豆精品视频在线观看视频| 中文字幕一区二区三区在线观看| 欧美一区二区视频在线观看 | 极品瑜伽女神91| 亚洲精品中文在线| 久久在线观看免费| 欧美视频三区在线播放| 成人一区二区视频| 免费av网站大全久久| 亚洲卡通动漫在线| 久久久国产午夜精品| 欧美一区二区三区视频在线 | 国产酒店精品激情| 亚洲第一成人在线| 国产精品久久久久久久久免费桃花 | 亚洲综合久久久久| 国产精品传媒视频| wwwwxxxxx欧美| 欧美一区二区三区视频在线| 在线免费观看一区| 99综合影院在线| 国产又黄又大久久| 日本女人一区二区三区| 亚洲午夜免费视频| 亚洲天堂av老司机| 国产精品成人一区二区三区夜夜夜| 精品国产99国产精品| 欧美一区二区在线看| 欧美日韩精品高清| 欧美亚洲国产一区二区三区va| 99在线精品一区二区三区| 精品电影一区二区三区| 日本高清视频一区二区| 成人一区在线观看| 国产福利一区二区| 国产精品亚洲一区二区三区妖精| 天堂午夜影视日韩欧美一区二区| 亚洲一区二区三区四区中文字幕| 日韩一区在线看| 国产精品你懂的在线| 国产精品久久久久久久久动漫| 国产三级精品三级在线专区| 久久毛片高清国产| 久久久五月婷婷| 欧美国产日韩在线观看| 国产精品久久久久国产精品日日| 国产欧美日韩卡一| 综合色中文字幕| 亚洲三级久久久| 一区av在线播放| 亚洲一区在线观看免费观看电影高清 | 日韩va亚洲va欧美va久久| 日韩黄色在线观看| 极品尤物av久久免费看| 国产精品66部| 99久久国产免费看| 在线观看日韩av先锋影音电影院| 在线视频你懂得一区二区三区| 欧美自拍偷拍午夜视频| 欧美一区二区三区精品| 精品美女在线播放| 国产欧美日韩卡一| 一区二区三区成人在线视频| 污片在线观看一区二区| 久久99精品久久久| 成人av综合在线| 欧美日韩一级片在线观看| 日韩一区二区影院| 欧美激情一区在线观看| 亚洲女子a中天字幕| 婷婷中文字幕综合| 国产真实乱偷精品视频免| av在线不卡电影| 欧美巨大另类极品videosbest | 国产日韩欧美a| 亚洲精品亚洲人成人网| 蜜臀91精品一区二区三区| 紧缚捆绑精品一区二区| 一本久久精品一区二区| 欧美一区二区三区在线观看视频 | 日韩三级在线观看| 中文字幕乱码日本亚洲一区二区| 亚洲一区二区三区在线看| 激情都市一区二区| 在线欧美日韩精品| 久久久久久麻豆| 亚洲电影一级片| 国产99一区视频免费| 欧美日韩国产综合一区二区| 国产日本亚洲高清| 婷婷中文字幕综合| 99re视频精品| 欧美mv和日韩mv国产网站| 亚洲精品成人悠悠色影视| 国内精品写真在线观看| 欧美丝袜第三区| 欧美极品美女视频| 美女视频第一区二区三区免费观看网站 | 日韩一区二区在线看片| 亚洲人成网站影音先锋播放| 日本特黄久久久高潮| 91麻豆swag| 国产亚洲精品精华液| 日韩综合小视频| 色综合久久中文综合久久牛| 久久久青草青青国产亚洲免观| 婷婷丁香激情综合| 在线亚洲人成电影网站色www| 国产亚洲精品超碰| 精品综合久久久久久8888| 欧美三区免费完整视频在线观看| 中文字幕第一区| 国产精品一区在线观看乱码| 欧美精品三级日韩久久| 玉足女爽爽91| 91麻豆精品在线观看| 国产精品久久99| 粉嫩aⅴ一区二区三区四区| 亚洲精品一区二区三区99| 免费精品视频最新在线| 这里只有精品视频在线观看| 亚洲国产精品久久不卡毛片| 91在线国产观看| 亚洲欧洲精品天堂一级| 成人免费高清在线观看| 亚洲国产精品二十页| 国产精品一区三区| 国产亚洲精品资源在线26u| 国产一区二区0| 久久在线免费观看| 国产成人午夜精品影院观看视频| 久久伊人中文字幕| 国产一区二区三区蝌蚪| 久久这里只有精品首页| 国产激情偷乱视频一区二区三区| 2023国产精品视频| 国产999精品久久久久久| 国产日韩精品久久久| 国产91精品久久久久久久网曝门| 国产情人综合久久777777| 国产福利电影一区二区三区| 亚洲国产精品成人综合 | 2019国产精品| 国产成人在线观看免费网站| 国产女主播在线一区二区| 成人久久视频在线观看| 亚洲国产精品精华液2区45| 99久久久无码国产精品| 亚洲激情av在线| 91精品黄色片免费大全| 精品一区二区三区视频| 国产三级精品在线| a4yy欧美一区二区三区| 亚洲永久免费av| 日韩三级电影网址| 国产精品亚洲一区二区三区在线 | 久久免费国产精品 | 欧美日韩久久久久久| 理论电影国产精品| 国产精品看片你懂得| 欧美三日本三级三级在线播放| 免费欧美高清视频| 国产精品嫩草影院com| 欧美性受极品xxxx喷水| 麻豆精品精品国产自在97香蕉| 国产亚洲成av人在线观看导航 | 欧美日韩成人综合在线一区二区|