亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
av资源网一区| 国产精品热久久久久夜色精品三区| 欧美v日韩v国产v| 亚洲免费资源在线播放| 国内成人自拍视频| 欧美日韩精品综合在线| 久久久久成人黄色影片| 日本不卡一二三| 在线观看网站黄不卡| 欧美国产禁国产网站cc| 久久精品国产色蜜蜜麻豆| 欧美丝袜丝交足nylons| |精品福利一区二区三区| 国产乱对白刺激视频不卡| 日韩一区二区三区视频| 亚洲一区二区三区在线看| 99视频精品全部免费在线| 久久免费的精品国产v∧| 久久精品噜噜噜成人av农村| 欧美三级午夜理伦三级中视频| 最新国产精品久久精品| 国产ts人妖一区二区| 久久久综合视频| 国内精品国产成人国产三级粉色| 日韩欧美色综合网站| 奇米色777欧美一区二区| 欧美日韩激情一区二区| 亚洲图片欧美综合| 欧美伊人久久久久久久久影院| 亚洲综合丝袜美腿| 欧美性色综合网| 亚洲成人av一区二区| 欧美日韩高清影院| 日韩精品欧美成人高清一区二区| 欧美性极品少妇| 午夜电影久久久| 6080午夜不卡| 久久成人av少妇免费| 日韩免费成人网| 国产一区二区伦理片| 中文字幕精品在线不卡| av资源网一区| 香蕉成人伊视频在线观看| 91精品国产综合久久久久久漫画| 日本视频免费一区| 久久男人中文字幕资源站| 成人av免费网站| 午夜视黄欧洲亚洲| 欧美大片免费久久精品三p | 日韩一区在线免费观看| 91在线视频免费观看| 亚洲大片在线观看| 欧美成人vps| aaa欧美日韩| 亚洲女爱视频在线| 99久久精品国产精品久久| 成人精品高清在线| 国产精品人人做人人爽人人添| 成人黄色综合网站| 亚洲一区中文日韩| 日韩欧美一区在线| 国产福利精品导航| 一区二区三区四区五区视频在线观看| 欧美曰成人黄网| 久久99这里只有精品| 亚洲色图一区二区三区| 91精品免费观看| 成人中文字幕在线| 亚洲成人1区2区| 国产欧美日韩精品一区| 欧美日韩在线三区| 国产精品1区2区3区| 亚洲一区二区三区中文字幕| 久久久久久久久99精品| 欧美性受xxxx| 成人三级伦理片| 蜜桃av一区二区三区| 亚洲视频一区二区在线观看| 欧美一卡2卡三卡4卡5免费| 盗摄精品av一区二区三区| 午夜久久久久久| 亚洲精品一二三| 国产欧美一区二区精品秋霞影院| 欧美色网站导航| a4yy欧美一区二区三区| 精品在线免费视频| 天堂久久一区二区三区| 亚洲精品成人少妇| 中文字幕欧美激情| 欧美电影免费观看高清完整版| 欧洲一区在线观看| 本田岬高潮一区二区三区| 精品在线播放免费| 日韩二区三区四区| 亚洲小少妇裸体bbw| 1024亚洲合集| 国产精品美女一区二区三区| 精品国产乱码久久久久久夜甘婷婷 | 午夜精品免费在线| 亚洲另类色综合网站| 国产精品乱人伦| 国产日韩欧美精品综合| 久久精品这里都是精品| 久久只精品国产| 欧美精品一区二区蜜臀亚洲| 91精品国产综合久久国产大片| 在线视频一区二区三区| 91在线观看地址| 色综合久久中文综合久久牛| 成人a免费在线看| 丁香六月综合激情| 成人app下载| 99综合影院在线| 不卡av免费在线观看| k8久久久一区二区三区 | 欧美日韩综合不卡| 91国在线观看| 欧美日韩中文一区| 欧美日韩高清一区二区不卡| 欧美日韩在线一区二区| 欧美一区二区私人影院日本| 欧美一区二区在线播放| 精品少妇一区二区三区免费观看| 久久综合给合久久狠狠狠97色69| 精品99一区二区| 国产精品人人做人人爽人人添| 国产精品久久久久影视| 亚洲男人的天堂在线观看| 一区二区激情视频| 日韩国产在线观看一区| 美女视频一区在线观看| 国产激情偷乱视频一区二区三区| 成人免费毛片a| 欧美性猛交xxxx乱大交退制版 | 91女人视频在线观看| 在线观看一区日韩| 91精品一区二区三区在线观看| 亚洲精品一线二线三线| 国产精品视频第一区| 一区二区三区国产豹纹内裤在线| 午夜电影一区二区三区| 韩国理伦片一区二区三区在线播放 | 精品在线播放免费| av中文字幕一区| 欧美精品tushy高清| 久久综合九色综合97_久久久| 最新不卡av在线| 蜜桃av一区二区在线观看| 成人精品亚洲人成在线| 欧美性猛片aaaaaaa做受| 2022国产精品视频| 亚洲免费av在线| 国内外精品视频| 在线观看视频一区二区欧美日韩| 精品国产乱码久久久久久1区2区| 最近中文字幕一区二区三区| 日韩成人精品在线| 色婷婷香蕉在线一区二区| 精品久久免费看| 一区二区三区产品免费精品久久75| 久国产精品韩国三级视频| 色综合久久久久久久久| 久久精品亚洲精品国产欧美| 丝瓜av网站精品一区二区| 懂色av一区二区三区免费观看| 欧美蜜桃一区二区三区| 最新欧美精品一区二区三区| 狠狠色狠狠色综合| 91 com成人网| 亚洲男人的天堂网| 成人免费福利片| 久久久不卡网国产精品二区| 午夜精品久久久久久久99水蜜桃| 成人一区二区视频| 欧美mv日韩mv国产网站app| 亚洲激情六月丁香| 成人综合激情网| 久久久影视传媒| 老司机一区二区| 69久久夜色精品国产69蝌蚪网| 夜夜嗨av一区二区三区中文字幕| 国产成人精品综合在线观看| 日韩欧美久久久| 免费精品视频在线| 欧美一区二区三区视频在线| 亚洲精品视频在线观看免费| 成人性视频网站| 国产欧美视频一区二区三区| 激情五月婷婷综合| 欧美成人午夜电影| 日本特黄久久久高潮| 制服丝袜国产精品| 爽爽淫人综合网网站 | 91视频免费看| 国产精品久久久久三级| 成人精品免费网站| 综合久久国产九一剧情麻豆| 91色|porny| 亚洲成av人综合在线观看| 欧美高清dvd|