12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870 |
- package kr.co.icontrols.wallpadcall.screen;
- import android.content.Context;
- import android.content.Intent;
- import android.graphics.Color;
- import android.os.Handler;
- import android.os.Looper;
- import android.os.Message;
- import android.util.Log;
- import android.view.Gravity;
- import android.view.KeyEvent;
- import android.view.LayoutInflater;
- import android.view.MotionEvent;
- import android.view.View;
- import android.widget.LinearLayout;
- import android.widget.RelativeLayout;
- import android.widget.RelativeLayout.LayoutParams;
- import android.widget.SeekBar;
- import android.widget.Toast;
- import com.artncore.wallpadimap.RetProci;
- import com.util.LogUtil;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import kr.co.icontrols.callengine.engine.CallController.CallEventListener;
- import kr.co.icontrols.callengine.engine.CallManager.CALLEVENTTYPE;
- import kr.co.icontrols.callengine.engine.CallManager.CALLOWNER;
- import kr.co.icontrols.callengine.engine.CallManager.CALLPATH;
- import kr.co.icontrols.callengine.engine.CallManager.CALLSTATUS;
- import kr.co.icontrols.callengine.engine.CallManager.CALLTYPE;
- import kr.co.icontrols.wallpadcall.MainActivity;
- import kr.co.icontrols.wallpadcall.MainActivity.MAINEVENT;
- import kr.co.icontrols.wallpadcall.MainActivity.MainEventListener;
- import kr.co.icontrols.wallpadcall.R;
- import kr.co.icontrols.wallpadcall.declare.Common;
- import kr.co.icontrols.wallpadcall.declare.DataClasses.MultiCallInfo;
- import kr.co.icontrols.wallpadcall.declare.DataClasses.RemoteIDInfo;
- import kr.co.icontrols.wallpadcall.declare.DataClasses.SmartRFCamLEDMode;
- import kr.co.icontrols.wallpadcall.declare.DataClasses.SmartRFCamStatusMode;
- import kr.co.icontrols.wallpadcall.declare.Declare;
- import kr.co.icontrols.wallpadcall.declare.Declare.DEVICENAME;
- import kr.co.icontrols.wallpadcall.declare.Declare.DeviceType;
- import kr.co.icontrols.wallpadcall.declare.Enumeration.TARGETINFOINPUTSTEP;
- import kr.co.icontrols.wallpadcall.declare.Global;
- import kr.co.icontrols.wallpadcall.declare.Global.BOARD_TYPE;
- import kr.co.icontrols.wallpadcall.declare.Global.CALLACTION;
- import kr.co.icontrols.wallpadcall.declare.Global.CALLDIRECTION;
- import kr.co.icontrols.wallpadcall.declare.Global.CALLRESULT;
- import kr.co.icontrols.wallpadcall.declare.Global.ConfigValues;
- import kr.co.icontrols.wallpadcall.declare.ID;
- import kr.co.icontrols.wallpadcall.imap.Request_call_history_save;
- import kr.co.icontrols.wallpadcall.imap.Request_check_sip_activation;
- import kr.co.icontrols.wallpadcall.imap.Request_visitor_picture_delete;
- import kr.co.icontrols.wallpadsupport.Version;
- import kr.co.icontrols.wallpadsupport.WpadImageView;
- import kr.co.icontrols.wallpadsupport.WpadImageView.TOUCH_KIND;
- import kr.co.icontrols.wallpadsupport.WpadScale;
- import kr.co.icontrols.wallpadsupport.WpadScreen;
- import kr.co.icontrols.wallpadsupport.WpadSound.SND;
- import kr.co.icontrols.wallpadsupport.WpadTextView;
- import static kr.co.icontrols.wallpadcall.MainActivity.bFFMPEGEnable;
- public class TalkResidence extends WpadScreen implements CallEventListener, MainEventListener {
- private final String TAG = "TalkResidence";
- boolean bLOG = true;
- private void LOG(String log) {
- if (bLOG) Log.v(TAG, log);
- }
- boolean bLOG_DEBUG = false;
- private void LOG_DEBUG(String log) {
- if (bLOG_DEBUG) Log.d(TAG, log);
- }
- boolean bLOG_INFO = true;
- private void LOG_INFO(String log) {
- if (bLOG_INFO) Log.i(TAG, log);
- }
- boolean bLOG_WARN = true;
- private void LOG_WARN(String log) {
- if (bLOG_WARN) Log.i(TAG, log);
- }
- boolean m_bCallStartBtnEnable = false;
- WpadImageView SCREEN_BG;
- WpadImageView IMG_RESIDENCE_BACKGROUND;
- WpadImageView IMG_VIDEO_MODULE;
- WpadImageView IMG_VOLUME;
- WpadImageView BTN_TALK;
- WpadImageView BTN_END;
- WpadImageView BTN_PORTRAIT;
- WpadImageView BTN_DELETE;
- WpadImageView BTN_DIVISION;
- WpadImageView[] BTN_TENKEY = new WpadImageView[6];
- int[][] TENKEYS = {
- {R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_pressed, R.drawable.btn_floor_1_selected}, //10.1.1.1
- {R.drawable.btn_floor_2_normal, R.drawable.btn_floor_2_pressed, R.drawable.btn_floor_2_selected}, //10.1.2.1
- {R.drawable.btn_floor_3_normal, R.drawable.btn_floor_3_pressed, R.drawable.btn_floor_3_selected}, //10.1.3.1
- {R.drawable.btn_main_room_normal, R.drawable.btn_main_room_pressed, R.drawable.btn_main_room_selected}, //10.1.3.2
- {R.drawable.btn_driver_normal, R.drawable.btn_driver_pressed, R.drawable.btn_driver_selected}, //10.1.1.3
- {R.drawable.btn_maid_normal, R.drawable.btn_maid_pressed, R.drawable.btn_maid_selected}, //10.1.1.2
- {R.drawable.btn_kitchen_normal, R.drawable.btn_kitchen_pressed, R.drawable.btn_kitchen_selected}, //10.1.2.2
- {R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal},
- {R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal},
- {R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal},
- {R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal},
- {R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal, R.drawable.btn_floor_1_normal}
- };
- String[] strEndIP = {"10.1.1.1", "10.1.2.1", "10.1.3.1", "10.1.3.2", "10.1.1.3", "10.1.1.2", "10.1.2.2"};
- WpadTextView TXT_RESIDENCEINFO; // 세대정보
- WpadTextView TXT_INSTRUCTION; // 안내문구
- String strTXT_RESIDENCEINFO = "";
- String strTXT_INSTRUCTION = "";
- SeekBar SEEKBAR_VOLUME;
- WpadTextView TXT_VOLUME_LEVEL;
- int m_nIDCnt_type = 0;
- boolean m_bCallStateThreadStop = true;
- class TextResources {
- static final String strDong = "동";
- static final String strHo = "호";
- static final String strInputResidenceInfo = "세대정보를\n 입력하세요.";
- static final String strTryingResidence = "호출합니다.";
- static final String strCallingResidence = "호출중입니다.";
- static final String strCalledResidence = "호출이\n 왔습니다.";
- static final String strTalkingResidence = "통화중입니다.";
- static final String strBusyTryCallLater = "통화중입니다. 잠시후에 호출 하세요.";
- static final String strTryAgain = "다시 시도하세요.";
- static final String strPSTNCalled_01 = "전화가 왔습니다.";
- static final String strPSTNCalled_02 = "통화를 수락하시겠습니까?";
- }
- int MAXLENGTH_DONG = 4;
- int MAXLENGTH_HO = 4;
- int MINLENGTH_DONG = 3;
- int MINLENGTH_HO = 3;
- int KEYBALANCE = ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_01 - 1;
- int nCurrentVolume = 0;
- boolean bshowMyVideo = false;
- boolean mbCameraONOFF = true;
- Context mContext;
- public TalkResidence(Context context, RelativeLayout layout) {
- super(context, layout);
- try {
- mContext = context;
- Initialize();
- SCREEN_BG = new WpadImageView(context, TOUCH_KIND.NONE, 1280, 690, R.drawable.bg_body, R.drawable.bg_body, ID.SCREEN.TALKRESIDENCE.ELEMENT.IMAGE.BG);
- ViewRegistration(layout, SCREEN_BG, 0, 0);
- IMG_RESIDENCE_BACKGROUND = new WpadImageView(context, TOUCH_KIND.NONE, 724, 544, R.drawable.bg_residence, 0, ID.SCREEN.TALKRESIDENCE.ELEMENT.IMAGE.BACKGROUND);
- ViewRegistration(layout, IMG_RESIDENCE_BACKGROUND, Common.ImgPosition.GetX(142), Common.ImgPosition.GetY(110));
- IMG_RESIDENCE_BACKGROUND.setVisibility(View.INVISIBLE);
- IMG_VIDEO_MODULE = new WpadImageView(context, TOUCH_KIND.NONE, 720, 540, R.drawable.image_neig, 0, ID.SCREEN.TALKRESIDENCE.ELEMENT.IMAGE.VIDEO_MODULE);
- ViewRegistration(layout, IMG_VIDEO_MODULE, Common.ImgPosition.GetX(144), Common.ImgPosition.GetY(112));
- IMG_VIDEO_MODULE.setVisibility(View.INVISIBLE);
- IMG_VOLUME = new WpadImageView(context, TOUCH_KIND.NONE, 40, 40, R.drawable.bar_icon_sound, 0, ID.SCREEN.TALKRESIDENCE.ELEMENT.IMAGE.VOLUME);
- ViewRegistration(layout, IMG_VOLUME, Common.ImgPosition.GetX(318), Common.ImgPosition.GetY(707));
- TXT_VOLUME_LEVEL = new WpadTextView(context, false, 40, 40, Gravity.CENTER, Color.WHITE, Common.fontsize._30, false, ID.SCREEN.TALKFRONT.ELEMENT.TEXT.VOLUME_LEVEL);
- ViewRegistration(layout, TXT_VOLUME_LEVEL, Common.ImgPosition.GetX(644), Common.ImgPosition.GetY(705));
- if (WpadScale.getWidthPixels() == WpadScale.DEFAULT_WIDTH_PIXELS) {
- LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- LinearLayout volumeLayout = (LinearLayout) inflater.inflate(R.layout.volume_seekbar_1280, null);
- LayoutParams volumeParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- int volMarginLeft = WpadScale.getWidth(Common.ImgPosition.GetX(359));
- int volMarginTop = WpadScale.getHeight(Common.ImgPosition.GetY(707));
- volumeParams.setMargins(volMarginLeft, volMarginTop, 0, 0);
- volumeLayout.setLayoutParams(volumeParams);
- SEEKBAR_VOLUME = (SeekBar) volumeLayout.findViewById(R.id.volumeSeekBar);
- SEEKBAR_VOLUME.setMax(100);
- SEEKBAR_VOLUME.setOnSeekBarChangeListener(mOnVolumeChangeListener);
- layout.addView(volumeLayout);
- }
- else {
- LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- LinearLayout volumeLayout = (LinearLayout) inflater.inflate(R.layout.volume_seekbar, null);
- LayoutParams volumeParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- int volMarginLeft = WpadScale.getWidth(Common.ImgPosition.GetX(366));
- int volMarginTop = WpadScale.getHeight(Common.ImgPosition.GetY(703));
- volumeParams.setMargins(volMarginLeft, volMarginTop, 0, 0);
- volumeLayout.setLayoutParams(volumeParams);
- SEEKBAR_VOLUME = (SeekBar) volumeLayout.findViewById(R.id.volumeSeekBar);
- SEEKBAR_VOLUME.setMax(100);
- SEEKBAR_VOLUME.setOnSeekBarChangeListener(mOnVolumeChangeListener);
- layout.addView(volumeLayout);
- }
- int nTenKeyGuide_X = Common.ImgPosition.GetX(142);
- int nTenKeyGuide_Y = Common.ImgPosition.GetY(148);
- int nIDCnt = 0;
- //String[] strEndIP = {"10.1.1.1", "10.1.1.2", "10.1.1.3", "10.1.1.4", "10.1.1.5", "10.1.1.6", "10.1.1.7"};
- int nIDCnt_img = -1;
- for(int i = 0; i < strEndIP.length; i++)
- {
- if (ConfigValues.strDeviceIPaddress.equals(strEndIP[i])) {
- m_nIDCnt_type = i;
- break;
- }
- }
- for (int i = 0; i < 2; i++) {
- for (int j = 0; j < 3; j++) {
- if(m_nIDCnt_type == nIDCnt)
- nIDCnt_img +=2;
- else
- nIDCnt_img++;
- BTN_TENKEY[nIDCnt] = new WpadImageView(context, TOUCH_KIND.BUTTON, 236, 230, TENKEYS[nIDCnt_img][0], TENKEYS[nIDCnt_img][1], ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_01 + nIDCnt_img);
- ViewRegistration(layout, BTN_TENKEY[nIDCnt], nTenKeyGuide_X, nTenKeyGuide_Y);
- nTenKeyGuide_X += 244;
- nIDCnt++;
- }
- nTenKeyGuide_X = Common.ImgPosition.GetX(142);
- nTenKeyGuide_Y += 238;
- }
- LOG("[TalkResidence] bWallPadCameraEnable [" + ConfigValues.bWallPadCameraEnable + "]");
- if (ConfigValues.bWallPadCameraEnable) {
- BTN_TALK = new WpadImageView(context, TOUCH_KIND.BUTTON, 230, 181, R.drawable.btn_residence_call_normal3, R.drawable.btn_residence_call_pressed3, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TALK_3);
- ViewRegistration(layout, BTN_TALK, Common.ImgPosition.GetX(908), Common.ImgPosition.GetY(110));
- BTN_END = new WpadImageView(context, TOUCH_KIND.BUTTON, 230, 182, R.drawable.btn_residence_end_normal3, R.drawable.btn_residence_end_pressed3, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.END_3);
- ViewRegistration(layout, BTN_END, Common.ImgPosition.GetX(908), Common.ImgPosition.GetY(291));
- BTN_PORTRAIT = new WpadImageView(context, TOUCH_KIND.BUTTON, 230, 181, R.drawable.btn_residence_me_normal3, R.drawable.btn_residence_me_pressed3, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.PORTRAIT_3);
- ViewRegistration(layout, BTN_PORTRAIT, Common.ImgPosition.GetX(908), Common.ImgPosition.GetY(473));
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- }
- else {
- BTN_TALK = new WpadImageView(context, TOUCH_KIND.BUTTON, 230, 272, R.drawable.btn_residence_call_normal2, R.drawable.btn_residence_call_pressed2, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TALK_2);
- ViewRegistration(layout, BTN_TALK, Common.ImgPosition.GetX(908), Common.ImgPosition.GetY(110));
- BTN_END = new WpadImageView(context, TOUCH_KIND.BUTTON, 230, 272, R.drawable.btn_residence_end_normal2, R.drawable.btn_residence_end_pressed2, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.END_2);
- ViewRegistration(layout, BTN_END, Common.ImgPosition.GetX(908), Common.ImgPosition.GetY(382));
- BTN_PORTRAIT = null;
- }
- // 부분 임대세대 적용여부 판단
- // if (ConfigValues.bEnableHouseDivision) {
- // Log.d(TAG, "[TalkResidenceScreen] bEnableHouseDivision TRUE 분리세대");
- // BTN_DELETE = new WpadImageView(context, TOUCH_KIND.BUTTON_LC, 154, 132, R.drawable.btn_num_del_normal2, R.drawable.btn_num_del_pressed2, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.DELETE);
- // ViewRegistration(layout, BTN_DELETE, Common.ImgPosition.GetX(144), Common.ImgPosition.GetY(520));
- //
- // BTN_DIVISION = new WpadImageView(context, TOUCH_KIND.BUTTON, 154, 132, R.drawable.btn_num_separation_normal, R.drawable.btn_num_separation_pressed, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.DIVISION);
- // ViewRegistration(layout, BTN_DIVISION, Common.ImgPosition.GetX(302), Common.ImgPosition.GetY(520));
- // } else {
- // BTN_DELETE = new WpadImageView(context, TOUCH_KIND.BUTTON_LC, 312, 132, R.drawable.btn_num_del_normal, R.drawable.btn_num_del_pressed, ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.DELETE);
- // ViewRegistration(layout, BTN_DELETE, Common.ImgPosition.GetX(144), Common.ImgPosition.GetY(520));
- // }
- //
- TXT_RESIDENCEINFO = new WpadTextView(context, false, 292, 284, Gravity.LEFT, context.getResources().getColor(R.color.orange), Common.fontsize._46, false, ID.SCREEN.TALKRESIDENCE.ELEMENT.TEXT.RESIDENCEINFO);
- ViewRegistration(layout, TXT_RESIDENCEINFO, Common.ImgPosition.GetX(155), Common.ImgPosition.GetY(111));
- TXT_RESIDENCEINFO.setText(strTXT_RESIDENCEINFO);
- //TXT_RESIDENCEINFO.setVisibility(View.GONE);
- TXT_INSTRUCTION = new WpadTextView(context, false, 317, 364, Gravity.CENTER, context.getResources().getColor(R.color.orange), Common.fontsize._52, true, ID.SCREEN.TALKRESIDENCE.ELEMENT.TEXT.INSTRUCTION);
- ViewRegistration(layout, TXT_INSTRUCTION, Common.ImgPosition.GetX(142), Common.ImgPosition.GetY(255));
- TXT_INSTRUCTION.setText(strTXT_INSTRUCTION);
- //TXT_INSTRUCTION.setVisibility(View.GONE);
- displayScreenValues();
- sendHandlerMsg(HANDLERMSG.PROC_ADDCALL, 0, 0);
- StateCamera();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] ScreenTalkResidence(Context context, RelativeLayout layout)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- protected void Initialize() {
- try {
- LOG_INFO("[Initialize]");
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.IDLE) ((MainActivity) mContext).setMenuBTNEnable(false);
- else ((MainActivity) mContext).setMenuBTNEnable(true);
- MainActivity.mCallController.setCallEventListener(this);
- ((MainActivity) mContext).setMainEventListener(this);
- int mMarginLeft = ((MainActivity) mContext).TopBackBtn.getVisibility() == View.VISIBLE ? 893 : 1019;
- ((MainActivity) mContext).setManualBtnVisible(((MainActivity) mContext).getManualUse(), mMarginLeft);
- ((MainActivity) mContext).setTopHideBtnVisible(true);
- super.setFinishTimerCreate(Common.FINISH_TIME_START_SCREEN);
- getVolume();
- if (MainActivity.bFFMPEGEnable) ((MainActivity)mContext).showRemoteVideo(false, false);
- MainActivity.mCallController.mVideoJNI.setDecoderInfo_V40(116, 85, 576, 405); // 세대통화시 영상 좌표 재설정
- //MainActivity.mIOInterface.ctrlPopupGUI_Resi(false, bshowMyVideo); // 세대통화 시작시 초기화
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] Initialize()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void initCallVariables() {
- try {
- if (!RemoteIDInfo.bAutoCall) RemoteIDInfo.InitVariables();
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- Global.TargetInputStep = TARGETINFOINPUTSTEP.DONG;
- strTXT_RESIDENCEINFO = "";
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] initCallVariables()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- protected void onClose() {
- super.onClose();
- try {
- LOG_INFO("[onClose]");
- if (MainActivity.mIOInterface != null) MainActivity.mIOInterface.ctrlWallPadLED_Call(false);
- if (mPathCheckHandler != null) {
- mPathCheckHandler.removeMessages(0);
- mPathCheckHandler.removeMessages(1);
- }
- mbCallState = false;
- MainActivity.mCallController.mSIPInterface.videoSet(false, false, false);
- MainActivity.mCallController.selectVideoSourceToSubPhone(CALLTYPE.NONE, true);
- MainActivity.mCallController.releaseCallEventListener();
- ((MainActivity) mContext).releaseMainEventListener();
- MainActivity.mCallController.stop1stCallTimer();
- MainActivity.mCallController.stop2ndCallTimer();
- initCallVariables();
- //Global.add1stCallHistoryInfoFinal();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onClose()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- protected void onBrReceive(Intent intent) {
- super.onBrReceive(intent);
- try {
- LOG_INFO("[onBrReceive] intent : " + intent);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onBrReceive()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- protected void onTouchEvent(View v, MotionEvent event) {
- super.onTouchEvent(v, event);
- try {
- int nEvent = event.getAction();
- int nID = v.getId();
- if (nEvent == MotionEvent.ACTION_UP) {
- LOG("[onTouchEvent] nID [" + nID + "], nEvent [" + nEvent + "]");
- if (ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TALK_2 <= nID && nID <= ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_HO) {
- if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TALK_2 || nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TALK_3) {
- // 통화중에 버튼 터치음을 발생시키면, 통화 상대방에게 터치음이 전달되므로 통화중에는 터치음을 출력하지 않는다.(JEFF, 2019.12.24)
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
- BTN_END.setButtonEventOffEnable(R.drawable.btn_residence_end_disabled2);
- m_bCallStartBtnEnable = true;
- new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
- @Override
- public void run() {
- BTN_END.setImageResource(R.drawable.btn_residence_end_normal3);
- BTN_END.setButtonEventOffDisable();
- m_bCallStartBtnEnable = false;
- }
- }, 2000);
- if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONE) {
- doTalk(CALLOWNER.WALLPAD);
- }
- else {
- MainActivity.mSound.Play(SND.setting.RETRY_INPUT);
- initCallVariables();
- updateScreen();
- }
- }
- else if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.END_2 || nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.END_3) {
- // 통화중에 버튼 터치음을 발생시키면, 통화 상대방에게 터치음이 전달되므로 통화중에는 터치음을 출력하지 않는다.(JEFF, 2019.12.24)
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
- doEnd();
- }
- else if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.PORTRAIT_3) {
- if (mbCameraONOFF) {
- // 통화중에 버튼 터치음을 발생시키면, 통화 상대방에게 터치음이 전달되므로 통화중에는 터치음을 출력하지 않는다.(JEFF, 2019.12.24)
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING)
- MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- showMyVideo(!bshowMyVideo);
- } else {
- LOG_WARN("[onTouchEvent] Call Status is not TALKING!!!");
- }
- } else {
- ((MainActivity) (getContext())).StartPopup(ID.POPUP.POPUP_NOTICE_CAMERAONOFF);
- }
- }
- else if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.DELETE) {
- // 통화중에 버튼 터치음을 발생시키면, 통화 상대방에게 터치음이 전달되므로 통화중에는 터치음을 출력하지 않는다.(JEFF, 2019.12.24)
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.IDLE) {
- deleteResiInfo();
- }
- else {
- LOG_WARN("[onTouchEvent] Call Status is not IDLE!!!");
- }
- }
- else if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.DIVISION) {
- // 통화중에 버튼 터치음을 발생시키면, 통화 상대방에게 터치음이 전달되므로 통화중에는 터치음을 출력하지 않는다.(JEFF, 2019.12.24)
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
- if (ConfigValues.bEnableHouseDivision) {
- if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONG) {
- RemoteIDInfo.strHo = RemoteIDInfo.strDong;
- RemoteIDInfo.strDong = ConfigValues.strDong;
- if (MINLENGTH_HO > RemoteIDInfo.strHo.length()) {
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- return;
- }
- RemoteIDInfo.bRentRoomSelected = true;
- RemoteIDInfo.nHo_Extension = 1;
- Global.TargetInputStep = TARGETINFOINPUTSTEP.HO;
- updateResidenceInfo();
- }
- else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.HO || Global.TargetInputStep == TARGETINFOINPUTSTEP.DONE) {
- RemoteIDInfo.bRentRoomSelected = true;
- RemoteIDInfo.nHo_Extension = 1;
- updateResidenceInfo();
- }
- }
- }
- else if (ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_01 <= nID && nID <= ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_09) {
- int nPressedNum = nID - KEYBALANCE;
- Global.TargetInputStep = TARGETINFOINPUTSTEP.DONG;
- playTenkeyNo(nID);
- Global.TargetInputStep = TARGETINFOINPUTSTEP.DONE;
- // if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONG) {
- // RemoteIDInfo.strDong += nPressedNum;
- // if (RemoteIDInfo.strDong.length() > MAXLENGTH_DONG) {
- // RemoteIDInfo.strDong = RemoteIDInfo.strDong.substring(1, 5);
- // }
- // playTenkeyNo(nID);
- // } else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.HO) {
- // RemoteIDInfo.strHo += nPressedNum;
- // if (RemoteIDInfo.strHo.length() > MAXLENGTH_HO) {
- // RemoteIDInfo.strHo = RemoteIDInfo.strHo.substring(1, 5);
- // }
- // playTenkeyNo(nID);
- // }
- updateResidenceInfo();
- } else if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_00) {
- int nPressedNum = 0;
- if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONG) {
- RemoteIDInfo.strDong += nPressedNum;
- if (RemoteIDInfo.strDong.length() > MAXLENGTH_DONG) {
- RemoteIDInfo.strDong = RemoteIDInfo.strDong.substring(1, 5);
- }
- playTenkeyNo(nID);
- } else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.HO) {
- RemoteIDInfo.strHo += nPressedNum;
- if (RemoteIDInfo.strHo.length() > MAXLENGTH_HO) {
- RemoteIDInfo.strHo = RemoteIDInfo.strHo.substring(1, 5);
- }
- playTenkeyNo(nID);
- }
- updateResidenceInfo();
- } else if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_DONG) {
- if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONG) {
- if (MINLENGTH_DONG > RemoteIDInfo.strDong.length()) {
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- return;
- }
- playTenkeyNo(nID);
- }
- Global.TargetInputStep = TARGETINFOINPUTSTEP.HO;
- updateResidenceInfo();
- } else if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_HO) {
- if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONG) {
- RemoteIDInfo.strHo = RemoteIDInfo.strDong;
- RemoteIDInfo.strDong = ConfigValues.strDong;
- if (MINLENGTH_HO > RemoteIDInfo.strHo.length()) {
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- return;
- }
- playTenkeyNo(nID);
- } else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.HO) {
- if (MINLENGTH_HO > RemoteIDInfo.strHo.length()) {
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- return;
- }
- playTenkeyNo(nID);
- }
- Global.TargetInputStep = TARGETINFOINPUTSTEP.DONE;
- updateResidenceInfo();
- }
- }
- } else if (nEvent == MotionEvent.ACTION_POINTER_DOWN) {
- LOG("[onTouchEvent] nID [" + nID + "], nEvent [" + nEvent + "]");
- if (nID == ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.DELETE) {
- // 통화중에 버튼 터치음을 발생시키면, 통화 상대방에게 터치음이 전달되므로 통화중에는 터치음을 출력하지 않는다.(JEFF, 2019.12.24)
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.IDLE) {
- initCallVariables();
- updateScreen();
- }
- else {
- LOG_WARN("[onTouchEvent] Call Status is not IDLE!!!");
- }
- }
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- public void onMainTouchEvent(MAINEVENT eEvent) {
- try {
- LOG_INFO("[onMainTouchEvent] eEvent [" + eEvent + "]");
- if (eEvent == MAINEVENT.BTN_HOME && m_bCallStartBtnEnable == false) {
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) Sound().Play(SND.effect.TOUCH_LATCHED);
- finishWallpadCallApp();
- } else if (eEvent == MAINEVENT.BTN_HOME_MOBILE) {
- finishWallpadCallApp();
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onMainTouchEvent(MAINEVENT eEvent)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- protected void onKeyDown(int keyCode, KeyEvent event) {
- LOG_INFO("[onKeyDown] keyCode [" + keyCode + "], event.getAction() [" + event.getAction() + "]");
- if ((keyCode == Declare.BTN.TALK || keyCode == Declare.BTN.TALK_V40) && m_bCallStartBtnEnable == false) {
- doTalkByBTN(CALLOWNER.WALLPAD);
- } else if (keyCode == Declare.BTN.PLAY_DECODED_VIDEO || (keyCode == Declare.BTN.PLAY_DECODED_VIDEO_V40 && ConfigValues.bWallPadCameraEnable)) {
- if (!MainActivity.bFFMPEGEnable) ctrlAlphaBlending(true);
- }
- super.onKeyDown(keyCode, event);
- }
- String mRemoteDong = "101";
- String mRemoteHo = "101";
- private boolean send_call_history_save(String strType, String strTime) {
- try {
- LOG_INFO("[send_call_history_save] strType() "+ strType + " strTime " + strTime);
- final Request_call_history_save call_history_save = new Request_call_history_save(mContext);
- if (call_history_save.send_call_history_save(mRemoteDong, mRemoteHo, strType, strTime)) {
- call_history_save.setResultCtrl(new RetProci() {
- @Override
- public void ProcSuccess() {
- LOG_INFO("[send_call_history_save] ProcSuccess() ");
- }
- @Override
- public void ProcError() {
- LOG_INFO("[send_call_history_save] ProcError()");
- //MainActivity.mCallController.mSIPInterface.cancelCallForwardToStun();
- }
- @Override
- public void ProcDoing() {
- LOG_INFO("[send_call_history_save] ProcDoing()");
- }
- });
- return true;
- }
- } catch (Exception e) {
- Log.e(TAG, "[Exception] send_call_history_save(String strTargetIP, String strMessage)");
- e.printStackTrace();
- }
- return false;
- }
- boolean mbCallState = false;
- @Override
- public void onCallEvent(CALLOWNER eCallOwner, CALLSTATUS eCallStatus, CALLTYPE eCallType, String strRemoteIP, String strRemoteSIPID, String strMessage) {
- try {
- LOG_INFO("[onCallEvent] eCallOwner [" + eCallOwner + "], eCallStatus [" + eCallStatus + "], eCallType [" + eCallType + "], strRemoteIP [" + strRemoteIP + "], strRemoteSIPID [" + strRemoteSIPID + "], strMessage [" + strMessage + "]");
- if (eCallType == CALLTYPE.NONE) return;
- if (eCallType == CALLTYPE.RESIDENCE) {
- MainActivity.mCallController.setRemoteInfo(strRemoteSIPID, strRemoteIP);
- setBTNStatus();
- if (eCallStatus == CALLSTATUS.CALLING) {
- mbCallState = true;
- bRcvEnd = false;
- mRemoteDong = RemoteIDInfo.strDong;
- mRemoteHo = RemoteIDInfo.strHo;
- Global.playMelodyRepeat(eCallType);
- super.setFinishTimerDestroy();
- if (Global.getKitchenTVIdx(eCallOwner) >= 0 || Global.getBathPhoneIdx(eCallOwner) >= 0 || eCallOwner == CALLOWNER.SUB_WALLPAD || Global.getBathTVIdx(eCallOwner) >= 0) {
- send_check_sip_activation_request(strRemoteIP);
- }
- MainActivity.mCallController.set1stCallTimer(eCallType, MainActivity.mCallController.mCTT.CALLING);
- updateInstruction();
- //Global.make1stCallHistoryInfo(strRemoteIP, strRemoteSIPID, CALLDIRECTION.OUT, CALLACTION.MISS, CALLRESULT.OUT_MISS);
- //strRemoteIP
- //setTunkeyImage(0);
- // String[] strEndIP = {"10.1.1.1", "10.1.1.2", "10.1.1.3", "10.1.1.4", "10.1.1.5", "10.1.1.6", "10.1.1.7"};
- //
- for(int i = 0; i < strEndIP.length; i++)
- {
- if (strRemoteIP.equals(strEndIP[i])) {
- setTunkeyImage(i);
- break;
- }
- }
- } else if (eCallStatus == CALLSTATUS.CALLED) {
- bRcvEnd = false;
- mRemoteDong = RemoteIDInfo.strDong;
- mRemoteHo = RemoteIDInfo.strHo;
- MainActivity.mIOInterface.ctrlLcdWakeUp();
- Global.playMelodyRepeat(eCallType);
- super.setFinishTimerDestroy();
- if (Global.getKitchenTVIdx(eCallOwner) >= 0 || Global.getBathPhoneIdx(eCallOwner) >= 0 || Global.getBathTVIdx(eCallOwner) >= 0 || eCallOwner == CALLOWNER.SUB_WALLPAD) {
- MainActivity.mSubPhoneController.sendACKNewCall(eCallOwner, eCallType, strRemoteIP, null);
- ((MainActivity)(getContext())).StartPopup(ID.POPUP.POPUP_NOTICE_SUBPHONETALK);
- }
- MainActivity.mCallController.set1stCallTimer(eCallType, MainActivity.mCallController.mCTT.CALLED);
- updateScreen();
- //Global.make1stCallHistoryInfo(strRemoteIP, strRemoteSIPID, CALLDIRECTION.IN, CALLACTION.MISS, CALLRESULT.IN_MISS);
- for(int i = 0; i < strEndIP.length; i++)
- {
- if (strRemoteIP.equals(strEndIP[i])) {
- CallStateThread nr = new CallStateThread(i) ;
- Thread t = new Thread(nr) ;
- t.start() ;
- break;
- }
- }
- }
- else if (eCallStatus == CALLSTATUS.TALKING) {
- Global.stopMelodyRepeat();
- m_bCallStateThreadStop = false;
- if (ConfigValues.bWallPadCameraEnable) {
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- prepareMyVideo(true);
- }
- }
- if (eCallOwner != CALLOWNER.WALLPAD) {
- ((MainActivity) mContext).StartPopup(ID.POPUP.POPUP_NOTICE_SUBPHONETALK);
- MainActivity.mCallController.setTalkPath(CALLPATH.SUBPHONE_MOIP);
- if (eCallOwner == CALLOWNER.SUB_WALLPAD) MainActivity.mCallController.setSubWallPadAudioPath();
- }
- else {
- ((MainActivity) mContext).sendHandlerMsg(MainActivity.HANDLERMSG.SET_TEMPSYSTEM_VOLUME, 0, 0);// 통화 중 임의 볼륨값 설정 seulki
- MainActivity.mCallController.setTalkPath(CALLPATH.MOIP_V40_RESIDENCE);
- }
- mPathCheckHandler.sendEmptyMessage(0);
- MainActivity.mCallController.set1stCallTimer(eCallType, MainActivity.mCallController.mCTT.RESIDENCEnRESIDENCE);
- updateInstruction();
- Global.change1stCallLogAction(CALLACTION.TALK);
- //Global.add1stCallHistoryInfoFinal();
- if(mbCallState)
- {
- String strTimeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date());
- send_call_history_save("call", strTimeStamp);
- mbCallState = false;
- }
- //String[] strEndIP = {"10.1.1.1", "10.1.1.2", "10.1.1.3", "10.1.1.4", "10.1.1.5", "10.1.1.6", "10.1.1.7"};
- for(int i = 0; i < strEndIP.length; i++)
- {
- if (strRemoteIP.equals(strEndIP[i])) {
- Thread.sleep(1000);
- setTunkeyImage(i);
- // new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
- // @Override
- // public void run() {
- //
- // }
- // }, 1500);
- break;
- }
- }
- }
- else if (eCallStatus == CALLSTATUS.HOMEVIEW) {
- LOG_WARN("[onCallEvent] MOBILE HOMEVIEW!!!!");
- // [방문객원격통화] 모바일에서 홈뷰어 요청 -> 모바일 기기로 월패드카메라 인코딩 영상 전송
- ((MainActivity) mContext).showRemoteCallNoticeText(true); // 방문객원격통화 팝업 삭제 -> 상단 문구로 대체
- // ((MainActivity) mContext).StartPopup(ID.POPUP.POPUP_NOTICE_REMOTECALL);
- prepareMyVideo(true);
- ((MainActivity) mContext).showMyVideo(true, true);
- MainActivity.mCallController.mSIPInterface.videoSet(true, true, true);
- MainActivity.mCallController.set1stCallTimer(eCallType, MainActivity.mCallController.mCTT.RESIDENCEnRESIDENCE); // 홈뷰어 타이머 3분
- //Global.make1stCallHistoryInfo("HOMEVIEW", "HOMEVIEW", CALLDIRECTION.OUT, CALLACTION.HOMEVIEW, CALLRESULT.OUT_HONEVIEW); // 통화기록 - 발신:세대:홈뷰어
- }
- else if (eCallStatus == CALLSTATUS.END) {
- Global.stopMelodyRepeat();
- bRemoteVideoShow = false;
- if (ConfigValues.bWallPadCameraEnable) {
- prepareMyVideo(false);
- }
- MainActivity.mCallController.setTalkPath(CALLPATH.NORMAL);
- if (bRcvEnd) {
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- return;
- }
- bRcvEnd = true;
- if (eCallOwner != CALLOWNER.WALLPAD) {
- //((MainActivity) mContext).showRemoteCallNoticeText(false);
- ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_NOTICE_SUBPHONETALK);
- }
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- initCallVariables();
- updateScreen();
- showMyVideo(false);
- MainActivity.mCallController.setTalkPath(CALLPATH.NORMAL);
- MainActivity.mCallController.MultiCallScenarioManager();
- } else if (eCallStatus == CALLSTATUS.REJECT) {
- Global.stopMelodyRepeat();
- if(mbCallState)
- {
- String strTimeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date());
- send_call_history_save("reject_call", strTimeStamp);
- mbCallState = false;
- }
- bRemoteVideoShow = false;
- if (ConfigValues.bWallPadCameraEnable) {
- prepareMyVideo(false);
- }
- MainActivity.mCallController.setTalkPath(CALLPATH.NORMAL);
- if (bRcvEnd) {
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- return;
- }
- bRcvEnd = true;
- int nTime = MainActivity.mSound.PlayMent(SND.call.BUSY_TRY_LATER);
- //int nTime = MainActivity.mSound.PlayMent(SND.call.TR.TRYLATER);
- Log.i(TAG, "[onCallEvent] nTime [" + nTime + "]");
- Thread.sleep(nTime + 500);
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- initCallVariables();
- updateScreen();
- Global.change1stCallLogAction(CALLACTION.REJECT);
- showMyVideo(false);
- MainActivity.mCallController.MultiCallScenarioManager();
- }
- else if (eCallStatus == CALLSTATUS.BUSY) {
- Global.stopMelodyRepeat();
- bRemoteVideoShow = false;
- if (ConfigValues.bWallPadCameraEnable) {
- prepareMyVideo(false);
- }
- MainActivity.mCallController.setTalkPath(CALLPATH.NORMAL);
- if (bRcvEnd) {
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- return;
- }
- bRcvEnd = true;
- int nTime = MainActivity.mSound.PlayMent(SND.call.BUSY_TRY_LATER);
- Log.i(TAG, "[onCallEvent] nTime [" + nTime + "]");
- Thread.sleep(nTime + 500);
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- initCallVariables();
- updateScreen();
- Global.change1stCallLogAction(CALLACTION.BUSY);
- showMyVideo(false);
- MainActivity.mCallController.MultiCallScenarioManager();
- } else if (eCallStatus == CALLSTATUS.CANCEL) {
- Global.stopMelodyRepeat();
- bRemoteVideoShow = false;
- if (ConfigValues.bWallPadCameraEnable) {
- prepareMyVideo(false);
- }
- MainActivity.mCallController.setTalkPath(CALLPATH.NORMAL);
- if (bRcvEnd) {
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- return;
- }
- bRcvEnd = true;
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- initCallVariables();
- updateScreen();
- Global.change1stCallLogAction(CALLACTION.CANCEL);
- showMyVideo(false);
- MainActivity.mCallController.MultiCallScenarioManager();
- } else if (eCallStatus == CALLSTATUS.FORWARD) {
- Global.stopMelodyRepeat();
- bRemoteVideoShow = false;
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- tryAutoCall(strMessage);
- } else if (eCallStatus == CALLSTATUS.TIMEOUT_1STCALL) {
- if(mbCallState)
- {
- String strTimeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new Date());
- send_call_history_save("missed_call", strTimeStamp);
- mbCallState = false;
- }
- Global.stopMelodyRepeat();
- bRemoteVideoShow = false;
- if (ConfigValues.bWallPadCameraEnable) {
- prepareMyVideo(false);
- }
- MainActivity.mCallController.setTalkPath(CALLPATH.NORMAL);
- if (eCallOwner != CALLOWNER.WALLPAD) {
- ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_NOTICE_SUBPHONETALK);
- }
- MainActivity.mCallController.quitMoIPCall();
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_NOTICE_SUBPHONETALK);
- initCallVariables();
- updateScreen();
- showMyVideo(false);
- MainActivity.mCallController.MultiCallScenarioManager();
- } else {
- Log.w(TAG, "[onCallEvent] Incorrect eCallStatus!!! eCallStatus = " + eCallStatus);
- }
- } else {
- onMultiCallEvent(eCallOwner, eCallStatus, eCallType, strRemoteIP, strRemoteSIPID, strMessage);
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onCallEvent(CALLOWNER eCallOwner, CALLSTATUS eCallStatus, CALLTYPE eCallType, String strRemoteIP, String strRemoteSIPID, String strMessage)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- public void onMultiCallEvent(CALLOWNER eCallOwner, CALLSTATUS eCallStatus, CALLTYPE eCallType, String strRemoteIP, String strRemoteSIPID, String strMessage) {
- try {
- LOG_INFO("[onMultiCallEvent] eCallOwner [" + eCallOwner + "], eCallStatus [" + eCallStatus + "], eCallType [" + eCallType + "], strRemoteIP [" + strRemoteIP + "], strRemoteSIPID [" + strRemoteSIPID + "], strMessage [" + strMessage + "]");
- MainActivity.mCallController.mCallInfo.printCallStatus();
- MainActivity.mCallController.mCallInfo.printMultiCallStatus();
- if (eCallStatus == CALLSTATUS.CALLED) {
- if (eCallType == CALLTYPE.FRONT) {
- playFrontCamBell(true);
- if (MainActivity.mCallController.mCallInfo.getMultiCallStatus() == CALLSTATUS.IDLE) {
- // 멀티콜 없음
- MultiCallInfo MCInfo = new MultiCallInfo();
- MCInfo.setMulticallInfo(CALLTYPE.RESIDENCE, eCallType, eCallStatus, CALLOWNER.NONE, strRemoteSIPID, "", "", "세대현관", strRemoteIP);
- MainActivity.mCallController.mCallInfo.setMultiCallInfo(MCInfo);
- //Global.make2ndCallHistoryInfo(eCallType.toString(), "NONE", CALLDIRECTION.IN, CALLACTION.MISS, CALLRESULT.IN_MISS);
- CALLSTATUS eResidenceCallStatus = MainActivity.mCallController.mCallInfo.getRESI();
- LOG("[onMultiCallEvent] eResidenceCallStatus [" + eResidenceCallStatus + "]");
- /**
- * JEFF, 2020.01.02
- * 모든통화에서 멀티콜 발생시 알림 팝업만 띄우고 busy처리 하도록 시나리오 수정
- */
- if (eResidenceCallStatus == CALLSTATUS.CALLING || eResidenceCallStatus == CALLSTATUS.CALLED || eResidenceCallStatus == CALLSTATUS.TALKING || eResidenceCallStatus == CALLSTATUS.HOMEVIEW) {
- if (eCallOwner == CALLOWNER.WALLPAD || eCallOwner == CALLOWNER.MOBILE || eCallOwner == CALLOWNER.NONE) {
- ((MainActivity) (getContext())).startMultiCallPopup(ID.POPUP.POPUP_MULTICALL_NOTICE);
- }
- else {
- if (MainActivity.mPSTNController != null) MainActivity.mPSTNController.stopPSTNRingCntThread(); // PSTN 멀티콜 거절시 ring cnt 초기화
- MainActivity.mCallController.stop2ndCallTimer();
- doMultiCallReject();
- // if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- // || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- // MainActivity.mIOInterface.ctrlPopupGUI_Resi(false, bshowMyVideo); // 현재 통화패스가 IHN-1010 이웃통화일 경우 멀티콜 거절시 GUI 화면이 아래로(영상이 위로)
- // }
- sendHandlerMsgDelayed(HANDLERMSG.REFRESH_BTNLED_STATUS, 0, 0, 1000);
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- LOG("[onMultiCallEvent] bRemoteVideoShow [" + bRemoteVideoShow + "]");
- if (bRemoteVideoShow) ctrlAlphaBlending(true); // 세대 월패드에서 내모습 보이기 출력중인 경우 멀티콜 거절시(팝업 종료시) 세대영상 출력
- else ctrlAlphaBlending(false);
- }
- }
- }
- else {
- LOG_WARN("[onMultiCallEvent] Invalid eResidenceCallStatus [" + eResidenceCallStatus + "]");
- }
- // LOG("[onMultiCallEvent] eResidenceCallStatus [" + eResidenceCallStatus + "]");
- // if (eResidenceCallStatus == CALLSTATUS.CALLING || eResidenceCallStatus == CALLSTATUS.CALLED) {
- // ((MainActivity) (getContext())).startMultiCallPopup(ID.POPUP.POPUP_MULTICALL_NOTICE);
- // } else if (eResidenceCallStatus == CALLSTATUS.TALKING) {
- // MainActivity.mCallController.set2ndCallTimer(eCallType, MainActivity.mCallController.mCTT.CALLED);
- // ((MainActivity) (getContext())).startMultiCallPopup(ID.POPUP.POPUP_MULTICALL);
- // } else {
- // LOG_WARN("[onMultiCallEvent] Invalid eResidenceCallStatus [" + eResidenceCallStatus + "]");
- // }
- }
- else {
- // 멀티콜 있음
- sendHandlerMsgDelayed(HANDLERMSG.OFF_FRONT, 0, 0, 2000);
- MainActivity.mCallController.mCallInfo.setCallStatus(eCallType, CALLSTATUS.IDLE);
- return;
- }
- }
- else if (eCallType == CALLTYPE.LOBBY || eCallType == CALLTYPE.GUARD || eCallType == CALLTYPE.RESIDENCE) {
- if (MainActivity.mCallController.mCallInfo.getMultiCallStatus() == CALLSTATUS.IDLE) {
- // 멀티콜 없음
- MultiCallInfo MCInfo = new MultiCallInfo();
- MCInfo.setMulticallInfo(CALLTYPE.RESIDENCE, eCallType, eCallStatus, CALLOWNER.NONE, strRemoteSIPID, Integer.toString(MainActivity.mCallController.getRemoteDong(strRemoteSIPID)),
- Integer.toString(MainActivity.mCallController.getRemoteID(strRemoteSIPID)), MainActivity.mCallController.getRemoteName(strRemoteSIPID, strRemoteIP), strRemoteIP);
- MainActivity.mCallController.mCallInfo.setMultiCallInfo(MCInfo);
- //Global.make2ndCallHistoryInfo(strRemoteIP, strRemoteSIPID, CALLDIRECTION.IN, CALLACTION.MISS, CALLRESULT.IN_MISS);
- CALLSTATUS eResidenceCallStatus = MainActivity.mCallController.mCallInfo.getRESI();
- /**
- * JEFF, 2020.01.02
- * 모든통화에서 멀티콜 발생시 알림 팝업만 띄우고 busy처리 하도록 시나리오 수정
- */
- if (eResidenceCallStatus == CALLSTATUS.CALLING || eResidenceCallStatus == CALLSTATUS.CALLED || eResidenceCallStatus == CALLSTATUS.TALKING || eResidenceCallStatus == CALLSTATUS.HOMEVIEW) {
- if (eCallOwner == CALLOWNER.WALLPAD || eCallOwner == CALLOWNER.NONE) {
- ((MainActivity) (getContext())).startMultiCallPopup(ID.POPUP.POPUP_MULTICALL_NOTICE);
- }
- else if (eCallOwner == CALLOWNER.MOBILE) {
- // 모바일로 홈뷰어 실행 중 멀티콜 오는 경우 통화중 처리
- MainActivity.mCallController.mCallInfo.setCallStatus(eCallType, CALLSTATUS.IDLE);
- MainActivity.mCallController.rejectMoIPCall();
- }
- else {
- if (MainActivity.mPSTNController != null) MainActivity.mPSTNController.stopPSTNRingCntThread(); // PSTN 멀티콜 거절시 ring cnt 초기화
- MainActivity.mCallController.stop2ndCallTimer();
- doMultiCallReject();
- // if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- // || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- // MainActivity.mIOInterface.ctrlPopupGUI_Resi(false, bshowMyVideo); // 현재 통화패스가 IHN-1010 이웃통화일 경우 멀티콜 거절시 GUI 화면이 아래로(영상이 위로)
- // }
- sendHandlerMsgDelayed(HANDLERMSG.REFRESH_BTNLED_STATUS, 0, 0, 1000);
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- LOG("[onMultiCallEvent] bRemoteVideoShow [" + bRemoteVideoShow + "]");
- if (bRemoteVideoShow) ctrlAlphaBlending(true); // 세대 월패드에서 내모습 보이기 출력중인 경우 멀티콜 거절시(팝업 종료시) 세대영상 출력
- else ctrlAlphaBlending(false);
- }
- }
- }
- else {
- LOG_WARN("[onMultiCallEvent] Invalid eResidenceCallStatus [" + eResidenceCallStatus + "]");
- }
- // if (eResidenceCallStatus == CALLSTATUS.CALLING || eResidenceCallStatus == CALLSTATUS.CALLED) {
- // ((MainActivity) (getContext())).startMultiCallPopup(ID.POPUP.POPUP_MULTICALL_NOTICE);
- // }
- // else if (eResidenceCallStatus == CALLSTATUS.TALKING) {
- // MainActivity.mCallController.set2ndCallTimer(eCallType, MainActivity.mCallController.mCTT.CALLED);
- // ((MainActivity) (getContext())).startMultiCallPopup(ID.POPUP.POPUP_MULTICALL);
- // }
- // else {
- // LOG_WARN("[onMultiCallEvent] Invalid eResidenceCallStatus [" + eResidenceCallStatus + "]");
- // }
- } else {
- // 멀티콜 있음
- MainActivity.mCallController.rejectMoIPMultiCall();
- MainActivity.mCallController.mCallInfo.setCallStatus(eCallType, CALLSTATUS.IDLE);
- }
- } else if (eCallType == CALLTYPE.PSTN) {
- TalkPSTN.bPSTNCalled = true;
- if (MainActivity.mCallController.mCallInfo.getMultiCallStatus() == CALLSTATUS.IDLE) {
- // 멀티콜 없음
- MultiCallInfo MCInfo = new MultiCallInfo();
- MCInfo.setMulticallInfo(CALLTYPE.RESIDENCE, eCallType, eCallStatus, CALLOWNER.NONE, strRemoteSIPID, "", "", "NONE", strRemoteIP);
- MainActivity.mCallController.mCallInfo.setMultiCallInfo(MCInfo);
- //Global.make2ndCallHistoryInfo(eCallType.toString(), "NONE", CALLDIRECTION.IN, CALLACTION.MISS, CALLRESULT.IN_MISS);
- ((MainActivity) (getContext())).startMultiCallPopup(ID.POPUP.POPUP_MULTICALL);
- } else {
- // 멀티콜 있음
- // 기존 멀티콜을 거절하고, 국선을 멀티콜로 설정한다.
- CALLTYPE eMulticallType = MainActivity.mCallController.mCallInfo.getMultiCallType();
- if (eMulticallType == CALLTYPE.FRONT) playFrontCamBell(false);
- else if (eMulticallType == CALLTYPE.LOBBY || eMulticallType == CALLTYPE.GUARD || eMulticallType == CALLTYPE.RESIDENCE)
- MainActivity.mCallController.rejectMoIPMultiCall();
- else
- LOG_WARN("[onMultiCallEvent] Invalid eMulticallType [" + eMulticallType + "]");
- MainActivity.mCallController.mCallInfo.setCallStatus(eMulticallType, CALLSTATUS.IDLE);
- MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- MainActivity.mCallController.stop2ndCallTimer();
- //Global.add2ndCallHistoryInfo(CALLRESULT.IN_MISS);
- LOG_WARN("[onMultiCallEvent] Another multicall is processing. Change multicall to PSTN multicall!!");
- MultiCallInfo MCInfo = new MultiCallInfo();
- MCInfo.setMulticallInfo(CALLTYPE.RESIDENCE, eCallType, eCallStatus, CALLOWNER.NONE, strRemoteSIPID, "", "", "NONE", strRemoteIP);
- MainActivity.mCallController.mCallInfo.setMultiCallInfo(MCInfo);
- //Global.make2ndCallHistoryInfo(eCallType.toString(), "NONE", CALLDIRECTION.IN, CALLACTION.MISS, CALLRESULT.IN_MISS);
- MainActivity.mCallController.mPopupEventListener.onMulticallChange(eCallType, eCallStatus, "");
- }
- } else {
- LOG_WARN("[onMultiCallEvent] Invalid CallType [" + eCallType + "]");
- }
- } else if (eCallStatus == CALLSTATUS.CALLERID) {
- MainActivity.mCallController.mCallInfo.updateMultiCallName(strRemoteSIPID);
- Global.change2ndCallLogSIPID(CALLTYPE.PSTN.toString() + ":" + strRemoteSIPID);
- } else if (eCallStatus == CALLSTATUS.END) {
- MainActivity.mCallController.mCallInfo.setCallStatus(eCallType, CALLSTATUS.IDLE);
- if (MainActivity.mCallController.mCallInfo.getMultiCallType() == eCallType) {
- MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- MainActivity.mCallController.stop2ndCallTimer();
- //Global.add2ndCallHistoryInfo(CALLRESULT.IN_MISS);
- ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_MULTICALL);
- } else LOG_WARN("[onMultiCallEvent] Invalid CallType [" + eCallType + "]");
- } else if (eCallStatus == CALLSTATUS.CANCEL) {
- MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- MainActivity.mCallController.mCallInfo.setCallStatus(eCallType, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop2ndCallTimer();
- //Global.add2ndCallHistoryInfo(CALLRESULT.IN_REJECT);
- ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_MULTICALL);
- } else if (eCallStatus == CALLSTATUS.FORWARD) {
- Global.stopMelodyRepeat();
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- tryAutoCall(strMessage);
- } else if (eCallStatus == CALLSTATUS.TIMEOUT_2NDCALL) {
- // 거동수상자 녹화기능 수정중 (추후 동작상태보고 수정)
- // if (eCallType == CALLTYPE.FRONT_RECORD) {
- // // [스마트현관카메라] 거동수상자 녹화 팝업 미선택시 녹화 시작
- // ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_MULTICALL_RECORD);
- // MainActivity.mCallController.stop2ndCallTimer();
- // MainActivity.mCallController.mSIPInterface.videoSet(false, false, false);
- // doMultiCallAccept();
- // } else {
- // doMultiCallReject();
- // Global.add2ndCallHistoryInfo(CALLRESULT.IN_MISS);
- // MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- // MainActivity.mCallController.mCallInfo.setCallStatus(eCallType, CALLSTATUS.IDLE);
- // ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_MULTICALL);
- // }
- doMultiCallReject();
- //Global.add2ndCallHistoryInfo(CALLRESULT.IN_MISS);
- if(MainActivity.mCallController.mCallInfo!=null)
- MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- if(MainActivity.mCallController.mCallInfo!=null)
- MainActivity.mCallController.mCallInfo.setCallStatus(eCallType, CALLSTATUS.IDLE);
- ((MainActivity) mContext).finishPopUp(ID.POPUP.POPUP_MULTICALL);
- } else {
- LOG_WARN("[onMultiCallEvent] Invalid CallStatus [" + eCallStatus + "]");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onMultiCallEvent(CALLOWNER eCallOwner, CALLSTATUS eCallStatus, CALLTYPE eCallType, String strRemoteIP, String strRemoteSIPID, String strMessage)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- public void onSubPhoneEvent(CALLOWNER eCallOwner, CALLSTATUS eCallStatus, CALLTYPE eCallType, String strTargetID, String strMessage) {
- try {
- LOG_INFO("[onSubPhoneEvent] eCallOwner [" + eCallOwner + "], eCallStatus [" + eCallStatus + "], eCallType [" + eCallType + "], strTargetID [" + strTargetID + "], strMessage [" + strMessage + "]");
- if (eCallType == CALLTYPE.NONE) return;
- if (eCallType == CALLTYPE.RESIDENCE) {
- if (eCallStatus == CALLSTATUS.TALKING) {
- if (eCallOwner != CALLOWNER.WALLPAD) {
- doTalk(eCallOwner);
- } else {
- MainActivity.mCallController.setTalkPath(CALLPATH.SUBPHONE_MOIP);
- }
- } else if (eCallStatus == CALLSTATUS.END) {
- if (eCallOwner != CALLOWNER.WALLPAD) {
- doEnd();
- }
- }
- else if (eCallStatus == CALLSTATUS.TRYING_CALL) {
- String[] strSplit = strTargetID.split(",");
- RemoteIDInfo.strDong = strSplit[0];
- RemoteIDInfo.strHo = strSplit[1];
- RemoteIDInfo.strIP = Global.makeIPAddress(DeviceType.RESIDENCE, strSplit[0], strSplit[1]);
- RemoteIDInfo.strName = strSplit[0] + "동 " + strSplit[1] + "호";
- if (!RemoteIDInfo.bAutoCall) RemoteIDInfo.bAutoCall = true;
- doAutoCall_sub();
- }
- else {
- Log.w(TAG, "[onSubPhoneEvent] Incorrect eCallStatus!!! eCallStatus = " + eCallStatus);
- }
- } else {
- Log.w(TAG, "[onSubPhoneEvent] Incorrect eCallType!!! eCallType = " + eCallType);
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onSubPhoneEvent(CALLOWNER eCallOwner, CALLSTATUS eCallStatus, CALLTYPE eCallType, String strTargetID, String strMessage)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- public void onVideoSet(boolean bSet, String strRemoteSIPID) {
- try {
- LOG_INFO("[onVideoSet] bSet [" + bSet + "], strRemoteSIPID [" + strRemoteSIPID + "]");
- if (bSet) {
- if (!strRemoteSIPID.contains(DEVICENAME.strType_Resi)) {
- Log.e(TAG, "[onVideoSet] Device name is not matched!!!");
- return;
- }
- }
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- Log.i(TAG, "[onVideoSet] ConfigValues.bWallPadCameraEnable [" + ConfigValues.bWallPadCameraEnable + "]");
- if (ConfigValues.bWallPadCameraEnable) {
- if (!bSet) showMyVideo(bSet);
- MainActivity.mCallController.mSIPInterface.videoSet(bSet, bSet, bSet);
- // if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- // MainActivity.mCallController.mSIPInterface.videoSet(bSet, bSet, bSet);
- // }
- // else {
- // Log.i(TAG, "[onVideoSet] CallStatus is NOT TALKING!!");
- // }
- }
- else {
- Log.w(TAG, "[onVideoSet] Wallpad camera is not enabled!!");
- }
- }
- else {
- LOG_WARN("[onVideoSet] Not Supported BOARD_TYPE!! [" + ConfigValues.DEVICE_BOARDTYPE + "]");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onVideoSet(boolean bSet, String strRemoteSIPID)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- boolean bRemoteVideoShow = false;
- @Override
- public void onShowRemoteVideo(boolean bShow) {
- try {
- LOG_INFO("[onShowRemoteVideo] bShow [" + bShow + "]");
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40
- || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT) {
- bRemoteVideoShow = bShow;
- LOG("[onShowRemoteVideo] bRemoteVideoShow [" + bRemoteVideoShow + "]");
- if (MainActivity.bFFMPEGEnable) {
- ((MainActivity)mContext).showRemoteVideo(bShow, true);
- }
- else {
- CALLOWNER eCallOwner = MainActivity.mCallController.mCallInfo.getCallOwner();
- CALLSTATUS eMultiCallStatus = MainActivity.mCallController.mCallInfo.getMultiCallStatus();
- LOG("[onShowRemoteVideo] eCallOwner [" + eCallOwner + "], eMultiCallStatus [" + eMultiCallStatus + "]");
- if (eCallOwner == CALLOWNER.WALLPAD) {
- if (eMultiCallStatus == CALLSTATUS.IDLE) {
- LOG("[onShowRemoteVideo] =========== POPUP X =========== (display remote video)");
- ctrlAlphaBlending(bShow); // 팝업(서브폰통화, 멀티콜)이 떠있지 않는 경우만 원격지 영상 출력-> 팝업 짤림 (02.12.01 seulki)
- }
- else {
- LOG("[onShowRemoteVideo] =========== POPUP O =========== (do not display remote video)");
- }
- }
- else {
- LOG("[onShowRemoteVideo] =========== POPUP O =========== (do not display remote video)");
- }
- }
- }
- else {
- LOG_WARN("[onShowRemoteVideo] Not Supported BOARD_TYPE!! [" + ConfigValues.DEVICE_BOARDTYPE + "]");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onShowRemoteVideo(boolean bShow)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- @Override
- protected void onPopupResult(Intent data) {
- try {
- int nScreen = data.getIntExtra("SCREEN", -1);
- int nID = data.getIntExtra("POPUP_BTN", -1);
- boolean bFinish = data.getBooleanExtra("FINISH_FLAG", false);
- Log.d(TAG, "[onPopupResult] nScreen: " + nScreen + ", nID: " + nID + ", bFinish: " + bFinish);
- if (nScreen == ID.POPUP.POPUP_MULTICALL) {
- if (nID == ID.POPUP.MUTICALL.ELEMENT.BUTTON.ACCEPT) {
- LOG_INFO("[onPopupResult] ID.POPUP.MUTICALL.ELEMENT.BUTTON.ACCEPT");
- MainActivity.mCallController.mSIPInterface.videoSet(false, false, false);
- MainActivity.mCallController.stop2ndCallTimer();
- doMultiCallAccept();
- } else if (nID == ID.POPUP.MUTICALL.ELEMENT.BUTTON.REJECT) {
- LOG_INFO("[onPopupResult] ID.POPUP.MUTICALL.ELEMENT.BUTTON.REJECT");
- if (MainActivity.mPSTNController != null) MainActivity.mPSTNController.stopPSTNRingCntThread(); // PSTN 멀티콜 거절시 ring cnt 초기화
- MainActivity.mCallController.stop2ndCallTimer();
- doMultiCallReject();
- // if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- // || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- // MainActivity.mIOInterface.ctrlPopupGUI_Resi(false, bshowMyVideo); // 현재 통화패스가 IHN-1010 이웃통화일 경우 멀티콜 거절시 GUI 화면이 아래로(영상이 위로)
- // }
- sendHandlerMsgDelayed(HANDLERMSG.REFRESH_BTNLED_STATUS, 0, 0, 1000);
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- LOG("[onPopupResult] bRemoteVideoShow [" + bRemoteVideoShow + "]");
- if (bRemoteVideoShow) ctrlAlphaBlending(true); // 세대 월패드에서 내모습 보이기 출력중인 경우 멀티콜 거절시(팝업 종료시) 세대영상 출력
- else ctrlAlphaBlending(false);
- }
- }
- // if (bFinish
- // && (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40
- // || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- // || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT))
- //MainActivity.mIOInterface.ctrlPopupGUI_Resi(false, bshowMyVideo); // 현재 통화패스가 IHN-1010 이웃통화일 경우 멀티콜 거절시 GUI 화면이 아래로(영상이 위로)
- } else if (nScreen == ID.POPUP.POPUP_NOTICE_SUBPHONETALK) {
- if (nID == ID.POPUP.NOTICE_SUBPHONETALK.ELEMENT.BUTTON.END) {
- LOG_INFO("[onPopupResult] ID.POPUP.NOTICE_SUBPHONETALK.ELEMENT.BUTTON.END");
- MainActivity.mCallController.stop2ndCallTimer();
- doEnd();
- }
- } else if (nScreen == ID.POPUP.POPUP_MULTICALL_NOTICE) {
- if (nID == ID.POPUP.MUTICALL_NOTICE.ELEMENT.BUTTON.CONFIRM) {
- LOG_INFO("[onPopupResult] ID.POPUP.POPUP_MULTICALL_NOTICE.ELEMENT.BUTTON.CONFIRM");
- // if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- // || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- // MainActivity.mIOInterface.ctrlPopupGUI_Resi(false, bshowMyVideo); // 현재 통화패스가 IHN-1010 이웃통화일 경우 멀티콜 거절시 GUI 화면이 아래로(영상이 위로)
- // }
- /**
- * JEFF, 2020.01.01
- * 모든 통화에서 멀티콜을 막음
- */
- if (MainActivity.mPSTNController != null) MainActivity.mPSTNController.stopPSTNRingCntThread(); // PSTN 멀티콜 거절시 ring cnt 초기화
- MainActivity.mCallController.stop2ndCallTimer();
- doMultiCallReject();
- // if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- // || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- // MainActivity.mIOInterface.ctrlPopupGUI_Resi(false, bshowMyVideo); // 현재 통화패스가 IHN-1010 이웃통화일 경우 멀티콜 거절시 GUI 화면이 아래로(영상이 위로)
- // }
- sendHandlerMsgDelayed(HANDLERMSG.REFRESH_BTNLED_STATUS, 0, 0, 1000);
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT
- || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- LOG("[onPopupResult] bRemoteVideoShow [" + bRemoteVideoShow + "]");
- if (bRemoteVideoShow) ctrlAlphaBlending(true); // 세대 월패드에서 내모습 보이기 출력중인 경우 멀티콜 거절시(팝업 종료시) 세대영상 출력
- else ctrlAlphaBlending(false);
- }
- }
- } else if (nScreen == ID.POPUP.POPUP_NOTICE_REMOTECALL) {
- if (nID == ID.POPUP.NOTICE_REMOTECALL.ELEMENT.BUTTON.END) {
- LOG_INFO("[onPopupResult] ID.POPUP.NOTICE_REMOTECALL.ELEMENT.BUTTON.END");
- doEnd();
- MainActivity.mRemoteCallController.sendCloseRemoteCall();
- MainActivity.mCallController.MultiCallScenarioManager();
- }
- } else if (nScreen == ID.POPUP.POPUP_NOTICE_CAMERAONOFF) {
- if (nID == ID.POPUP.NOTICE_CAMERAONOFF.ELEMENT.BUTTON.END) {
- LOG_INFO("[onPopupResult] ID.POPUP.NOTICE_CAMERAONOFF.ELEMENT.BUTTON.END");
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- }
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] onPopupResult(Intent data)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- boolean bRcvEnd = false;
- private void doTalk(CALLOWNER eCallOwner) {
- try {
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.IDLE) {
- ((MainActivity) mContext).setMenuBTNEnable(false);
- if (MINLENGTH_DONG > RemoteIDInfo.strDong.length() || MINLENGTH_HO > RemoteIDInfo.strHo.length()) {
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- updateScreen();
- ((MainActivity) mContext).setMenuBTNEnable(true);
- return;
- }
- try {
- if (RemoteIDInfo.bRentRoomSelected)
- RemoteIDInfo.strIP = Global.makeIPAddress(DeviceType.RENTRESIDENCE, RemoteIDInfo.strDong, RemoteIDInfo.strHo);
- else
- RemoteIDInfo.strIP = Global.makeIPAddress(DeviceType.RESIDENCE, RemoteIDInfo.strDong, RemoteIDInfo.strHo);
- Log.d(TAG, "[doTalk] ConfigValues.strDeviceIPaddress: " + ConfigValues.strDeviceIPaddress + ", RemoteIDInfo.strIP: " + RemoteIDInfo.strIP);
- if (ConfigValues.strDeviceIPaddress.equals(RemoteIDInfo.strIP)) {
- Log.e(TAG, "[doTalk] IPAddress is same!!");
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- updateScreen();
- ((MainActivity) mContext).setMenuBTNEnable(true);
- return;
- }
- } catch (RuntimeException re) {
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- ((MainActivity) mContext).setMenuBTNEnable(true);
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- Log.e(TAG, "[Exception] doTalk -> EthernetCtrl.makeIPAddress(...)");
- ((MainActivity) mContext).setMenuBTNEnable(true);
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- if (!send_check_sip_activation_request(RemoteIDInfo.strIP)) {
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- updateScreen();
- ((MainActivity) mContext).setMenuBTNEnable(true);
- return;
- }
- MainActivity.mCallController.mCallInfo.setCallOwner(eCallOwner);
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.TRYING_CALL);
- }
- else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLED) {
- MainActivity.mCallController.mCallInfo.setCallOwner(eCallOwner);
- MainActivity.mCallController.acceptMoIPCall(false);
- }
- else {
- LOG_INFO("[doTalk] Invalid CALLSTATUS [" + MainActivity.mCallController.mCallInfo.getRESI() + "]");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- MainActivity.mCallController.mCallInfo.setCallOwner(CALLOWNER.NONE);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] doTalk()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- MainActivity.mCallController.mCallInfo.setCallOwner(CALLOWNER.NONE);
- }
- }
- private void doEnd() {
- try {
- if (MainActivity.mCallController.mCallInfo.getIDLECnt() != MainActivity.mCallController.mCallInfo.IDLECNT_MAX) {
- LOG("[doEnd] MainActivity.mCallController.mCallInfo.getRESI() = " + MainActivity.mCallController.mCallInfo.getRESI());
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLED) {
- Global.change1stCallLogAction(CALLACTION.REJECT);
- bshowMyVideo = false;
- Global.stopMelodyRepeat();
- MainActivity.mCallController.rejectMoIPCall();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLING) {
- bshowMyVideo = false;
- Global.stopMelodyRepeat();
- MainActivity.mCallController.quitMoIPCall();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- if (ConfigValues.bWallPadCameraEnable) {
- // ctrlAlphaBlending(false);
- showMyVideo(false);
- if(BTN_PORTRAIT!=null)
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- }
- bshowMyVideo = false;
- MainActivity.mCallController.quitMoIPCall();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.HOMEVIEW) {
- MainActivity.mRemoteCallController.sendCloseRemoteCall();
- MainActivity.mCallController.MultiCallScenarioManager();
- bshowMyVideo = false;
- prepareMyVideo(false);
- showMyVideo(false);
- MainActivity.mCallController.mSIPInterface.videoSet(false, false, false);
- MainActivity.mCallController.mVideoJNI.encoderStopOperation();
- } else {
- LOG_INFO("[doEnd] Invalid CALLSTATUS [" + MainActivity.mCallController.mCallInfo.getRESI() + "]");
- MainActivity.mCallController.quitMoIPCall();
- }
- } else {
- LOG_INFO("[doEnd] IDLE Cnt is not MAX [" + MainActivity.mCallController.mCallInfo.IDLECNT_MAX + "]");
- MainActivity.mCallController.mCallInfo.printCallStatus();
- MainActivity.mCallController.MultiCallScenarioManager();
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] doEnd()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void doTalkByBTN(CALLOWNER eCallOwner) {
- try {
- LOG_INFO("[doTalkByBTN] CALLSTATUS [" + MainActivity.mCallController.mCallInfo.getRESI() + "]");
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLING) {
- MainActivity.mCallController.quitMoIPCall();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLED) {
- MainActivity.mCallController.acceptMoIPCall(false);
- MainActivity.mCallController.mCallInfo.setCallOwner(eCallOwner);
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- MainActivity.mCallController.quitMoIPCall();
- } else {
- LOG_INFO("[doTalkByBTN] Invalid CALLSTATUS [" + MainActivity.mCallController.mCallInfo.getRESI() + "]");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] doTalkByBTN(CALLOWNER eCallOwner)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void doMultiCallAccept() {
- try {
- MainActivity.mCallController.mCallInfo.setMultiCallAcceptFlag(true);
- doEnd();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] doMultiCallAccept()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void doMultiCallReject() {
- try {
- CALLTYPE eMultiCallType = MainActivity.mCallController.mCallInfo.getMultiCallType();
- if (eMultiCallType == CALLTYPE.FRONT) {
- playFrontCamBell(false);
- MainActivity.mCallController.mCallInfo.setCallStatus(eMultiCallType, CALLSTATUS.IDLE);
- } else if (eMultiCallType == CALLTYPE.LOBBY || eMultiCallType == CALLTYPE.GUARD || eMultiCallType == CALLTYPE.RESIDENCE) {
- MainActivity.mCallController.rejectMoIPMultiCall();
- MainActivity.mCallController.mCallInfo.setCallStatus(eMultiCallType, CALLSTATUS.IDLE);
- } else if (eMultiCallType == CALLTYPE.PSTN) {
- if(MainActivity.mPSTNController!=null)
- MainActivity.mPSTNController.sendReject();
- MainActivity.mCallController.onPSTNEvent(CALLEVENTTYPE.CANCEL_CALL, null, null);
- if(MainActivity.mCallController.mCallInfo!=null)
- MainActivity.mCallController.mCallInfo.setCallStatus(eMultiCallType, CALLSTATUS.IDLE);
- } else {
- LOG_WARN("[doMultiCallReject] Invalid eMultiCallType [" + eMultiCallType + "]");
- }
- if(MainActivity.mCallController.mCallInfo!=null)
- MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] doMultiCallReject()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void doAutoCall() {
- try {
- Log.e(TAG, "[doAutoCall] RemoteIDInfo.bAutoCall [" + RemoteIDInfo.bAutoCall + "]");
- if (RemoteIDInfo.bAutoCall) {
- RemoteIDInfo.bAutoCall = false;
- LOG("[doAutoCall] strDong [" + RemoteIDInfo.strDong + "], strHo [" + RemoteIDInfo.strHo + "], strIP [" + RemoteIDInfo.strIP + "]");
- if (!send_check_sip_activation_request(RemoteIDInfo.strIP)) {
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.guard.TRYLATER);
- return;
- }
- MainActivity.mCallController.mCallInfo.setCallOwner(CALLOWNER.WALLPAD);
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.TRYING_CALL);
- updateResidenceInfo();
- } else {
- LOG("[doAutoCall] AutoCall is not activated!!");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] doAutoCall()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void doAutoCall_sub() {
- try {
- Log.e(TAG, "[doAutoCall_sub] RemoteIDInfo.bAutoCall [" + RemoteIDInfo.bAutoCall + "]");
- if (RemoteIDInfo.bAutoCall) {
- RemoteIDInfo.bAutoCall = false;
- LOG("[doAutoCall_sub] strDong [" + RemoteIDInfo.strDong + "], strHo [" + RemoteIDInfo.strHo + "], strIP [" + RemoteIDInfo.strIP + "]");
- if (!send_check_sip_activation_request(RemoteIDInfo.strIP)) {
- Log.e(TAG, "[doAutoCall_sub] send_check_sip_activation_request [error]");
- initCallVariables();
- MainActivity.mSound.PlayMent(SND.guard.TRYLATER);
- return;
- }
- MainActivity.mCallController.mCallInfo.setCallOwner(CALLOWNER.SUB_WALLPAD);
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.TRYING_CALL);
- updateResidenceInfo();
- } else {
- LOG("[doAutoCall] AutoCall is not activated!!");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] doAutoCall()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void procAddCall() {
- try {
- LOG("[procAddCall]");
- CALLTYPE eMType = MainActivity.mCallController.mCallInfo.getMultiCallType();
- CALLSTATUS eMStatus = MainActivity.mCallController.mCallInfo.getMultiCallStatus();
- LOG("[procAddCall] eMType [" + eMType + "], eMStatus [" + eMStatus + "]");
- if (eMType == CALLTYPE.RESIDENCE && eMStatus == CALLSTATUS.CALLED) {
- MainActivity.mCallController.setRemoteInfo(MainActivity.mCallController.mCallInfo.getMultiCall_ID(), MainActivity.mCallController.mCallInfo.getMultiCall_IP());
- //Global.replace1stBy2ndCallHistory();
- if (MainActivity.mCallController.mCallInfo.getMultiCallAccept()) {
- // 멀티콜 수락 (통화시작)
- ((MainActivity) mContext).setMenuBTNEnable(false);
- if (ConfigValues.bWallPadCameraEnable) BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled3);
- else BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled2);
- if (ConfigValues.bWallPadCameraEnable) {
- prepareMyVideo(true);
- BTN_PORTRAIT.setButtonEventOffDisable();
- BTN_PORTRAIT.setImageResource(R.drawable.btn_residence_me_normal3);
- }
- showTalkMode(true);
- super.setFinishTimerDestroy();
- MainActivity.mCallController.set1stCallTimer(eMType, MainActivity.mCallController.mCTT.RESIDENCEnRESIDENCE);
- doTalk(CALLOWNER.WALLPAD);
- } else {
- // 멀티콜 수신중 (호출수신중)
- Global.playMelodyRepeat(eMType);
- super.setFinishTimerDestroy();
- Global.TargetInputStep = TARGETINFOINPUTSTEP.DONE;
- updateResidenceInfo();
- MainActivity.mCallController.set1stCallTimer(eMType, MainActivity.mCallController.mCTT.CALLED);
- }
- setBTNStatus();
- MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- } else {
- LOG("[procAddCall] No MultiCall!!");
- // 멀티콜 없음
- if (RemoteIDInfo.bAutoCall) {
- doAutoCall(); // 멀티콜 상황이 아닌경우 자동호출을 수행함
- }
- MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] procAddCall()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void playFrontCamBell(boolean bBell) {
- try {
- MainActivity.mIOInterface.ctrlFrontCamPower(bBell);
- MainActivity.mIOInterface.ctrlFrontCamBell(bBell);
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
- if (bBell) {
- ((MainActivity) mContext).ctrlSmartIOTCamStatusMode(SmartRFCamStatusMode.STATUS_ON);
- ((MainActivity) mContext).ctrlSmartIOTCamLEDMode(SmartRFCamLEDMode.LED_ON);
- } else {
- ((MainActivity) mContext).ctrlSmartIOTCamStatusMode(SmartRFCamStatusMode.STATUS_OFF);
- ((MainActivity) mContext).ctrlSmartIOTCamLEDMode(SmartRFCamLEDMode.LED_OFF);
- }
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] playFrontCamBell(boolean bBell)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- boolean bAutoCallRun = false;
- private boolean tryAutoCall(String strAutoCallInfo) {
- try {
- if (bAutoCallRun) return false;
- bAutoCallRun = true;
- LOG("[tryAutoCall] strAutoCallInfo [" + strAutoCallInfo + "]");
- String[] strParse_01 = strAutoCallInfo.split(":");
- String[] strParse_02 = strParse_01[1].split("@");
- String[] strParse_03 = strParse_02[1].split(":");
- String strForwardTarget_SIPID = strParse_02[0];
- String strForwardTarget_IP = strParse_03[0];
- CALLTYPE eCallType = MainActivity.mCallController.tryAutoMoIPCall(strForwardTarget_IP, strForwardTarget_SIPID);
- if (eCallType == CALLTYPE.FRONT || eCallType == CALLTYPE.LOBBY || eCallType == CALLTYPE.PSTN || eCallType == CALLTYPE.NONE)
- return false;
- else if (eCallType == CALLTYPE.GUARD) {
- ((MainActivity) mContext).changeMenuNScreen(ID.MENU.MENU_TALKGUARD);
- return true;
- } else if (eCallType == CALLTYPE.RESIDENCE) {
- doAutoCall();
- return true;
- } else {
- return false;
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- return false;
- } catch (Exception e) {
- Log.e(TAG, "[Exception] tryAutoCall(String strAutoCallInfo)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- return false;
- }
- }
- private boolean send_check_sip_activation_request(String strTargetIP) {
- try {
- Request_check_sip_activation check_sip_activation = new Request_check_sip_activation(mContext);
- if (check_sip_activation.send_check_sip_activation(strTargetIP, null)) {
- check_sip_activation.setResultCtrl(new RetProci() {
- @Override
- public void ProcSuccess() {
- LOG_INFO("[send_check_sip_activation_request] ProcSuccess()");
- bRcvEnd = false;
- if (RemoteIDInfo.bRentRoomSelected) {
- MainActivity.mCallController.tryMoIPCall(CALLTYPE.RENTRESIDENCE, RemoteIDInfo.strDong, RemoteIDInfo.strHo);
- } else {
- MainActivity.mCallController.tryMoIPCall(CALLTYPE.RESIDENCE, RemoteIDInfo.strDong, RemoteIDInfo.strHo);
- }
- MainActivity.mSubPhoneController.sendACKNewCall(CALLOWNER.SUB_WALLPAD, CALLTYPE.RESIDENCE);
- }
- @Override
- public void ProcError() {
- LOG_INFO("[send_check_sip_activation_request] ProcError()");
- // initCallVariables();
- // MainActivity.mSound.PlayMent(SND.setting.RETRY_INPUT);
- // updateScreen();
- // ((MainActivity) mContext).setMenuBTNEnable(true);
- // MainActivity.mSubPhoneController.sendBusyCall(CALLOWNER.SUB_WALLPAD, CALLTYPE.RESIDENCE);
- int nTime = MainActivity.mSound.PlayMent(SND.call.BUSY_TRY_LATER);
- try {
- Thread.sleep(nTime + 500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- initCallVariables();
- updateScreen();
- Global.change1stCallLogAction(CALLACTION.BUSY);
- MainActivity.mCallController.MultiCallScenarioManager();
- ((MainActivity) mContext).setMenuBTNEnable(true);
- MainActivity.mSubPhoneController.sendBusyCall(CALLOWNER.SUB_WALLPAD, CALLTYPE.RESIDENCE);
- /*
- new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
- @Override
- public void run() {
- MainActivity.mCallController.mCallInfo.setCallStatus(CALLTYPE.RESIDENCE, CALLSTATUS.IDLE);
- MainActivity.mCallController.stop1stCallTimer();
- initCallVariables();
- updateScreen();
- Global.change1stCallLogAction(CALLACTION.BUSY);
- MainActivity.mCallController.MultiCallScenarioManager();
- ((MainActivity) mContext).setMenuBTNEnable(true);
- MainActivity.mSubPhoneController.sendBusyCall(CALLOWNER.SUB_WALLPAD, CALLTYPE.RESIDENCE);
- }
- }, nTime + 500);
- }
- @Override
- public void ProcDoing() {
- LOG_INFO("[send_check_sip_activation_request] ProcDoing()");
- }
- });
- return true;
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] send_check_sip_activation_request(String strTargetIP, String strMessage)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- return false;
- }
- private void ctrlAlphaBlending(boolean bON) {
- try {
- LOG("[ctrlAlphaBlending] bON [" + bON + "]");
- int BOARDTYPE = ConfigValues.DEVICE_BOARDTYPE;
- if (BOARDTYPE == BOARD_TYPE.V40_IGW300 || BOARDTYPE == BOARD_TYPE.V40 || BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT || BOARDTYPE == BOARD_TYPE.V40_NOUGAT) {
- if (bON) {
- //IMG_VIDEO_MODULE.setImageResource(R.drawable.video_black_back);
- MainActivity.mCallController.mVideoJNI.setPreviewInfo_V40(116, 85, 240, 160);
- }
- else {
- //IMG_VIDEO_MODULE.setImageResource(R.drawable.image_neig);
- MainActivity.mCallController.mVideoJNI.setPreviewInfo_V40(0, 0, 0, 0);
- }
- //MainActivity.mIOInterface.ctrlPopupGUI_Resi(!bON, bshowMyVideo);
- }
- else {
- Log.w(TAG, "[ctrlAlphaBlending] Not supported BOARDTYPE!! [" + BOARDTYPE + "]");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] ctrlAlphaBlending(boolean bON)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void displayScreenValues() {
- try {
- getVolume();
- drawVolume();
- showTalkMode(false);
- updateInstruction();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] displayScreenValues()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void setBTNStatus() {
- try {
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLING) {
- ((MainActivity) mContext).setMenuBTNEnable(false);
- if (ConfigValues.bWallPadCameraEnable) {
- BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled3);
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- } else {
- BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled2);
- }
- showTalkMode(false);
- runFlickerCallLED();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLED) {
- ((MainActivity) mContext).setMenuBTNEnable(false);
- if (ConfigValues.bWallPadCameraEnable) {
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- }
- showTalkMode(false);
- runFlickerCallLED();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- ((MainActivity) mContext).setMenuBTNEnable(false);
- if (ConfigValues.bWallPadCameraEnable) {
- BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled3);
- sendHandlerMsgDelayed(HANDLERMSG.ENABLE_PORTRAIT, 0, 0, 3000);
- } else {
- BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled2);
- }
- showTalkMode(true);
- setOnCallLED();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.HOMEVIEW) {
- ((MainActivity) mContext).setMenuBTNEnable(false);
- if (ConfigValues.bWallPadCameraEnable) {
- BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled3);
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- } else {
- BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled2);
- }
- showTalkMode(true);
- } else {
- ((MainActivity) mContext).setMenuBTNEnable(true);
- // 버튼 이미지 조작
- BTN_TALK.setButtonEventOffDisable();
- BTN_TALK.setImageResource(R.drawable.btn_residence_call_normal3);
- if (ConfigValues.bWallPadCameraEnable) {
- BTN_TALK.setImageResource(R.drawable.btn_residence_call_normal3);
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- } else {
- BTN_TALK.setImageResource(R.drawable.btn_residence_call_normal2);
- }
- showTalkMode(false);
- setOffCallLED();
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] setBTNStatus()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void setBTNLEDStatus() {
- try {
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLING) {
- runFlickerCallLED();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLED) {
- runFlickerCallLED();
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- setOnCallLED();
- } else {
- setOffCallLED();
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] setBTNLEDStatus()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void updateResidenceInfo() {
- try {
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.IDLE) {
- if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONG) {
- if (RemoteIDInfo.strDong.length() > 0) {
- // 첫자리에 "0"이 출력되지 않도록 숫자로 변경하면서 "0"을 제거하고, 다시 String으로 변환한다.
- RemoteIDInfo.nDong = Integer.parseInt(RemoteIDInfo.strDong);
- RemoteIDInfo.strDong = Integer.toString(RemoteIDInfo.nDong);
- }
- strTXT_RESIDENCEINFO = RemoteIDInfo.strDong;
- } else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.HO) {
- if (RemoteIDInfo.strDong.length() > 0) {
- // 첫자리에 "0"이 출력되지 않도록 숫자로 변경하면서 "0"을 제거하고, 다시 String으로 변환한다.
- RemoteIDInfo.nDong = Integer.parseInt(RemoteIDInfo.strDong);
- RemoteIDInfo.strDong = Integer.toString(RemoteIDInfo.nDong);
- }
- strTXT_RESIDENCEINFO = RemoteIDInfo.strDong + TextResources.strDong;
- if (RemoteIDInfo.strHo.length() > 0) {
- // 첫자리에 "0"이 출력되지 않도록 숫자로 변경하면서 "0"을 제거하고, 다시 String으로 변환한다.
- RemoteIDInfo.nHo = Integer.parseInt(RemoteIDInfo.strHo);
- RemoteIDInfo.strHo = Integer.toString(RemoteIDInfo.nHo);
- }
- if (ConfigValues.bEnableHouseDivision && RemoteIDInfo.bRentRoomSelected)
- strTXT_RESIDENCEINFO += "\n" + RemoteIDInfo.strHo + "-" + RemoteIDInfo.nHo_Extension;
- else strTXT_RESIDENCEINFO += "\n" + RemoteIDInfo.strHo;
- } else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONE) {
- if (RemoteIDInfo.strDong.length() > 0) {
- // 첫자리에 "0"이 출력되지 않도록 숫자로 변경하면서 "0"을 제거하고, 다시 String으로 변환한다.
- RemoteIDInfo.nDong = Integer.parseInt(RemoteIDInfo.strDong);
- RemoteIDInfo.strDong = Integer.toString(RemoteIDInfo.nDong);
- }
- strTXT_RESIDENCEINFO = RemoteIDInfo.strDong + TextResources.strDong;
- if (RemoteIDInfo.strHo.length() > 0) {
- // 첫자리에 "0"이 출력되지 않도록 숫자로 변경하면서 "0"을 제거하고, 다시 String으로 변환한다.
- RemoteIDInfo.nHo = Integer.parseInt(RemoteIDInfo.strHo);
- RemoteIDInfo.strHo = Integer.toString(RemoteIDInfo.nHo);
- }
- if (ConfigValues.bEnableHouseDivision && RemoteIDInfo.bRentRoomSelected)
- strTXT_RESIDENCEINFO += "\n" + RemoteIDInfo.strHo + "-" + RemoteIDInfo.nHo_Extension + TextResources.strHo;
- else strTXT_RESIDENCEINFO += "\n" + RemoteIDInfo.strHo + TextResources.strHo;
- }
- } else {
- LOG_WARN("[updateResidenceInfo] Call Status is not IDLE!!!");
- strTXT_RESIDENCEINFO = RemoteIDInfo.strName;
- }
- // 2017.11.16 SEULKI
- // '세대정보를 입력하세요.' 화면에서 동/호 입력한 경우, 동/호 텍스트만 나오게
- if (!strTXT_RESIDENCEINFO.equals("") && (strTXT_INSTRUCTION.equals(TextResources.strInputResidenceInfo)))
- strTXT_INSTRUCTION = "";
- // 동/호 텍스트 지웠을 경우, 다시 '세대정보를 입력하세요.' 텍스트 나오게
- if (strTXT_RESIDENCEINFO.equals("") && (strTXT_INSTRUCTION.equals("")))
- strTXT_INSTRUCTION = TextResources.strInputResidenceInfo;
- TXT_INSTRUCTION.setText(strTXT_INSTRUCTION);
- TXT_RESIDENCEINFO.setText(strTXT_RESIDENCEINFO);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] updateResidenceInfo()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void deleteResiInfo() {
- try {
- if (RemoteIDInfo.bRentRoomSelected) {
- RemoteIDInfo.bRentRoomSelected = false;
- RemoteIDInfo.nHo_Extension = 0;
- } else {
- if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONG) {
- int nDongLength = RemoteIDInfo.strDong.length();
- if (nDongLength > 0) {
- RemoteIDInfo.strDong = RemoteIDInfo.strDong.substring(0, nDongLength - 1);
- }
- } else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.HO) {
- int nHoLength = RemoteIDInfo.strHo.length();
- if (nHoLength > 0) {
- RemoteIDInfo.strHo = RemoteIDInfo.strHo.substring(0, nHoLength - 1);
- } else {
- Global.TargetInputStep = TARGETINFOINPUTSTEP.DONG;
- }
- } else if (Global.TargetInputStep == TARGETINFOINPUTSTEP.DONE) {
- Global.TargetInputStep = TARGETINFOINPUTSTEP.HO;
- }
- }
- updateResidenceInfo();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] deleteResiInfo()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void updateInstruction() {
- try {
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.IDLE) {
- strTXT_INSTRUCTION = TextResources.strInputResidenceInfo;
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TRYING_CALL) {
- strTXT_INSTRUCTION = TextResources.strTryingResidence;
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.WAITNG_INVITE_ACK) {
- strTXT_INSTRUCTION = TextResources.strCallingResidence;
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLING) {
- strTXT_INSTRUCTION = TextResources.strCallingResidence;
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLED) {
- strTXT_INSTRUCTION = TextResources.strCalledResidence;
- Global.TargetInputStep = TARGETINFOINPUTSTEP.DONE;
- } else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- strTXT_INSTRUCTION = TextResources.strTalkingResidence;
- if (MainActivity.mCallController.bTalkTestModeEnable) {
- strTXT_INSTRUCTION = strTXT_INSTRUCTION + " [음량 " + Global.getWallPadMoIPVolume() + "]";
- }
- } else {
- strTXT_INSTRUCTION = "";
- }
- TXT_INSTRUCTION.setText(strTXT_INSTRUCTION);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] updateInstruction()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void updateScreen() {
- try {
- updateResidenceInfo();
- updateInstruction();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] updateScreen()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void showTalkMode(boolean bTalk) {
- try {
- LOG("[showTalkMode] bTalk [" + bTalk + "]");
- if (bTalk) {
- // 세대정보/안내문구
- // TXT_RESIDENCEINFO.setVisibility(View.VISIBLE);
- // TXT_INSTRUCTION.setVisibility(View.VISIBLE);
- // 텐키 이미지 조작
- //IMG_VIDEO_MODULE.setVisibility(View.VISIBLE);
- // TXT_RESIDENCEINFO.setVisibility(View.VISIBLE);
- // TXT_INSTRUCTION.setVisibility(View.VISIBLE);
- //BTN_DELETE.setVisibility(View.INVISIBLE);
- // if (ConfigValues.bEnableHouseDivision) {
- // if(BTN_DIVISION!=null)
- // BTN_DIVISION.setVisibility(View.INVISIBLE);
- // }
- // for (int i = 0; i < BTN_TENKEY.length; i++) {
- // BTN_TENKEY[i].setVisibility(View.INVISIBLE);
- // }
- // 통화상대 정보
- ((MainActivity) mContext).displayRemoteID(null);
- } else {
- // 세대정보/안내문구
- if(MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.IDLE)
- {
- TXT_RESIDENCEINFO.setVisibility(View.INVISIBLE);
- TXT_INSTRUCTION.setVisibility(View.INVISIBLE);
- for (int i = 0; i < BTN_TENKEY.length; i++) {
- BTN_TENKEY[i].setVisibility(View.VISIBLE);
- }
- }
- else
- {
- // TXT_RESIDENCEINFO.setVisibility(View.VISIBLE);
- // TXT_INSTRUCTION.setVisibility(View.VISIBLE);
- for (int i = 0; i < BTN_TENKEY.length; i++) {
- BTN_TENKEY[i].setButtonEventOffEnable();
- }
- }
- // 텐키 이미지 조작
- //BTN_DELETE.setVisibility(View.VISIBLE);
- // if (ConfigValues.bEnableHouseDivision) {
- // if(BTN_DIVISION!=null)
- // BTN_DIVISION.setVisibility(View.VISIBLE);
- // }
- // for (int i = 0; i < BTN_TENKEY.length; i++) {
- // if(BTN_TENKEY[i]!=null)
- // BTN_TENKEY[i].setVisibility(View.VISIBLE);
- // }
- IMG_VIDEO_MODULE.setVisibility(View.INVISIBLE);
- // 통화상대 정보
- ((MainActivity) mContext).displayRemoteID(null);
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] showTalkMode(boolean bTalk)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void showMyVideo(boolean bShow) {
- try {
- LOG_INFO("[showMyVideo] bShow [" + bShow + "]");
- if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) {
- LOG_INFO("[showMyVideo] CallStatus is NOT TALKING!!");
- return;
- }
- if (BTN_PORTRAIT != null) {
- bshowMyVideo = bShow;
- LOG_INFO("[showMyVideo] bshowMyVideo [" + bshowMyVideo + "]");
- ((MainActivity) mContext).showMyVideo(bshowMyVideo, false);
- if (bShow) {
- BTN_PORTRAIT.setImageResource(R.drawable.btn_residence_me_selected);
- } else {
- BTN_PORTRAIT.setImageResource(R.drawable.btn_residence_me_normal3);
- }
- //MainActivity.mIOInterface.ctrlPopupGUI_Resi(!bRemoteVideoShow, bshowMyVideo); // 세대통화 시작시 초기화
- }
- else {
- LOG_WARN("[showMyVideo] BTN_PORTRAIT is null!!");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] showMyVideo(boolean bShow)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- boolean bMyVideoPrepared = false;
- private void prepareMyVideo(boolean bOn) {
- try {
- LOG_INFO("[prepareMyVideo] bOn [" + bOn + "]");
- if (!MainActivity.bFFMPEGEnable) ctrlAlphaBlending(false);
- if (bOn) {
- if (bMyVideoPrepared) return;
- bMyVideoPrepared = true;
- ((MainActivity) mContext).initMyVideoSurfaceLayout();
- } else {
- ((MainActivity) mContext).finishMyVideo();
- bMyVideoPrepared = false;
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] prepareMyVideo(boolean bOn)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- // Handler mHandler = new Handler() ;
- //
- // class CallStateThread extends Thread {
- // Handler handler = mHandler ;
- // int m_iVal = 0;
- // int m_iVal1 = 0;
- // boolean m_bImageSet = false;
- // boolean m_bStop = true;
- //
- // public void CallStateThread(int val)
- // {
- // m_iVal = val;
- // if(m_nIDCnt_type < val)
- // m_iVal1 = val - 1;
- // }
- //
- // public void ThreadStop()
- // {
- // m_bStop = false;
- // }
- //
- // @Override
- // public void run() {
- // while (m_bStop) {
- // // create Runnable instance.
- // Runnable runnable = new Runnable() {
- // @Override
- // public void run() {
- // // TODO : 실행 코드 작성.
- // if(m_bImageSet)
- // {
- // BTN_TENKEY[m_iVal1].setButtonDefaultImageID();
- // m_bImageSet = false;
- // }
- // else
- // {
- // BTN_TENKEY[m_iVal1].setButtonPressedImageID();
- // m_bImageSet = true;
- // }
- //
- // //BTN_TENKEY[m_iVal1].setImageResource(TENKEYS[m_iVal][2]);
- // }
- // };
- //
- // // send runnable object.
- // handler.post(runnable) ;
- //
- // try {
- // Thread.sleep(500);
- // } catch (InterruptedException e) {
- // e.printStackTrace();
- // }
- // }
- // }
- //
- // }
- class CallStateThread implements Runnable {
- int m_iVal = 0;
- int m_iImageSet = 0;
- CallStateThread(int val) {
- if(m_nIDCnt_type < val)
- m_iVal = val - 1;
- else
- m_iVal = val;
- }
- public void run() {
- // TODO : thread running codes.
- while (m_bCallStateThreadStop) {
- Message msg = handler.obtainMessage();
- msg.arg1 = m_iVal;
- msg.arg2 = m_iImageSet;
- handler.sendMessage(msg);
- if(m_iImageSet == 0) m_iImageSet = 1;
- else if(m_iImageSet == 1) m_iImageSet = 0;
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- //
- // Message msg = handler.obtainMessage();
- //
- // msg.arg1 = m_iVal;
- // msg.arg2 = 2;
- // handler.sendMessage(msg);
- }
- }
- final Handler handler = new Handler()
- {
- public void handleMessage(Message msg)
- {
- if(m_bCallStateThreadStop)
- {
- if(msg.arg2 == 0)
- {
- BTN_TENKEY[msg.arg1].setButtonPressedImageID();
- }
- else if(msg.arg2 == 1)
- {
- BTN_TENKEY[msg.arg1].setButtonDefaultImageID();
- }
- else if(msg.arg2 == 2)
- {
- //BTN_TENKEY[msg.arg1].setButtonDefaultImageID();
- BTN_TENKEY[msg.arg1].setImageResource(TENKEYS[msg.arg1][2]);
- //setTunkeyImage(msg.arg1);
- }
- }
- }
- };
- private void setTunkeyImage(int val)
- {
- int ival = 0;
- if(m_nIDCnt_type < val)
- ival = val - 1;
- else
- ival = val;
- for(int i = 0; i < BTN_TENKEY.length; i++)
- {
- if(ival == i)
- {
- BTN_TENKEY[i].setImageResource(TENKEYS[val][2]);
- }
- else
- {
- BTN_TENKEY[i].setButtonDefaultImageID();
- }
- }
- }
- private void playTenkeyNo(int nBTN) {
- try {
- int nSoundIndex = SND.effect.TOUCH_LATCHED;
- switch (nBTN) {
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_00:
- //nSoundIndex = SND.number.NUM0;
- break;
- //String[] strEndIP = {"10.1.1.1", "10.1.2.1", "10.1.3.1", "10.1.3.2", "10.1.1.3", "10.1.1.2", "10.1.2.2"};
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_01:
- //nSoundIndex = SND.number.NUM1;
- RemoteIDInfo.strDong = "101";
- RemoteIDInfo.strHo = "101";
- setTunkeyImage(0);
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_02:
- //nSoundIndex = SND.number.NUM2;
- RemoteIDInfo.strDong = "101";
- RemoteIDInfo.strHo = "201";
- setTunkeyImage(1);
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_03:
- //nSoundIndex = SND.number.NUM3;
- RemoteIDInfo.strDong = "101";
- RemoteIDInfo.strHo = "301";
- setTunkeyImage(2);
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_04:
- //nSoundIndex = SND.number.NUM4;
- RemoteIDInfo.strDong = "101";
- RemoteIDInfo.strHo = "302";
- setTunkeyImage(3);
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_05:
- //nSoundIndex = SND.number.NUM5;
- RemoteIDInfo.strDong = "101";
- RemoteIDInfo.strHo = "103";
- setTunkeyImage(4);
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_06:
- //nSoundIndex = SND.number.NUM6;
- RemoteIDInfo.strDong = "101";
- RemoteIDInfo.strHo = "102";
- setTunkeyImage(5);
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_07:
- //nSoundIndex = SND.number.NUM7;
- RemoteIDInfo.strDong = "101";
- RemoteIDInfo.strHo = "202";
- setTunkeyImage(6);
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_08:
- //nSoundIndex = SND.number.NUM8;
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_09:
- //nSoundIndex = SND.number.NUM9;
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_DONG:
- //nSoundIndex = SND.setting.DONG;
- break;
- case ID.SCREEN.TALKRESIDENCE.ELEMENT.BUTTON.TENKEY_HO:
- //nSoundIndex = SND.setting.HO;
- break;
- }
- MainActivity.mSound.Play(nSoundIndex);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] playTenkeyNo(int nBTN)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void StateCamera() {
- if (ConfigValues.DEVICE_MODELTYPE != Version.MODEL_TYPE.IHN_DW101_I) {
- mbCameraONOFF = true;
- return;
- }
- Log.d(TAG, "[StateCamera]");
- String cmd = "getprop get.camera.onoff";
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- Runtime mRuntime = Runtime.getRuntime();
- Process mProcess;
- try {
- mProcess = mRuntime.exec(cmd);
- BufferedReader br = new BufferedReader(new InputStreamReader(mProcess.getInputStream()));
- String line;
- String strResult = null;
- while ((line = br.readLine()) != null) {
- strResult = line;
- }
- if (strResult.equals("1")) {
- } else {
- mbCameraONOFF = false;
- if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- showMyVideo(false);
- BTN_PORTRAIT.setButtonEventOffEnable(R.drawable.btn_residence_me_disabled3);
- BTN_PORTRAIT.setEnabled(false);
- Toast.makeText(getContext(), "카메라가 전원이 꺼져 내모습 영상을 종료합니다.", Toast.LENGTH_SHORT).show();
- }
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- @Override
- protected void onKeyUp(int keyCode, KeyEvent event) {
- super.onKeyUp(keyCode, event);
- if (ConfigValues.DEVICE_MODELTYPE == Version.MODEL_TYPE.IHN_DW101_I)
- if (keyCode == 267) {
- StateCamera();
- }
- }
- // LED
- boolean bFlickeringCallLED = false;
- boolean bStatusFlickeringCallLED = false;
- private void runFlickerCallLED() {
- try {
- LOG("[runFlickerCallLED] bFlickeringCallLED [" + bFlickeringCallLED + "]");
- if (!bFlickeringCallLED) {
- bFlickeringCallLED = true;
- sendHandlerMsg(HANDLERMSG.FLICKER_LED_CALL, 0, 0);
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] runFlickerCallLED()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void setOnCallLED() {
- try {
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT) {
- bFlickeringCallLED = false;
- bStatusFlickeringCallLED = true;
- MainActivity.mIOInterface.ctrlWallPadLED_Call(bStatusFlickeringCallLED);
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] setOnCallLED()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void setOffCallLED() {
- try {
- LOG("[setOffCallLED] bStatusFlickeringCallLED [" + bStatusFlickeringCallLED + "]");
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT) {
- bFlickeringCallLED = false;
- if (bStatusFlickeringCallLED) {
- bStatusFlickeringCallLED = false;
- MainActivity.mIOInterface.ctrlWallPadLED_Call(bStatusFlickeringCallLED);
- }
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] setOffCallLED()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void ctrlCallLED() {
- try {
- LOG_INFO("[ctrlCallLED] bFlickeringCallLED [" + bFlickeringCallLED + "], bStatusFlickeringCallLED [" + bStatusFlickeringCallLED + "]");
- LOG_INFO("[ctrlCallLED] MainActivity.mCallController.mCallInfo.getRESI() [" + MainActivity.mCallController.mCallInfo.getRESI() + "]");
- if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT) {
- if ((MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLING) || (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.CALLED)) {
- if (bFlickeringCallLED) {
- MainActivity.mIOInterface.ctrlWallPadLED_Call(bStatusFlickeringCallLED);
- bStatusFlickeringCallLED = !bStatusFlickeringCallLED;
- sendHandlerMsgDelayed(HANDLERMSG.FLICKER_LED_CALL, 0, 0, 1000);
- }
- }
- else if (MainActivity.mCallController.mCallInfo.getRESI() == CALLSTATUS.TALKING) {
- bStatusFlickeringCallLED = true;
- MainActivity.mIOInterface.ctrlWallPadLED_Call(bStatusFlickeringCallLED);
- }
- else {
- bStatusFlickeringCallLED = false;
- MainActivity.mIOInterface.ctrlWallPadLED_Call(bStatusFlickeringCallLED);
- LOG_INFO("[ctrlCallLED] bFlickeringCallLED [" + bFlickeringCallLED + "], bStatusFlickeringCallLED [" + bStatusFlickeringCallLED + "]");
- }
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] ctrlCallLED()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- // 음량
- SeekBar.OnSeekBarChangeListener mOnVolumeChangeListener = new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- int nCtrlLevel = getCtrlLevel(progress);
- if (nCurrentVolume != nCtrlLevel) {
- nCurrentVolume = nCtrlLevel;
- showVolume(nCurrentVolume);
- // ctrlVolume(false);
- }
- }
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
- }
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
- // Log.d(TAG, "[onStopTrackingTouch] nCurrentVolume:" + nCurrentVolume);
- nCurrentVolume = getCtrlLevel(seekBar.getProgress());
- ctrlVolume(true);
- }
- };
- private void getVolume() {
- try {
- nCurrentVolume = Global.getResidenceVolume();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] getVolume()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void setVolume(int nValue) {
- try {
- if (!Global.setResidenceVolume(nValue)) {
- LOG_WARN("[setVolume] Fail to set volume!! nValue [" + nValue + "]");
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] setVolume()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void ctrlVolume(boolean bSave) {
- try {
- if (bSave) setVolume(nCurrentVolume);
- CALLSTATUS eCallStatus = MainActivity.mCallController.mCallInfo.getRESI();
- LOG("[ctrlVolume] eCallStatus [" + eCallStatus + "]");
- if (eCallStatus == CALLSTATUS.TALKING) {
- Global.setV40WallPadVolume_RESIDENCE(nCurrentVolume);
- }
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] ctrlVolume()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private void showVolume(int nValue) {
- try {
- // Log.d(TAG, "[showVolume] nValue [" + nValue + "]");
- if (TXT_VOLUME_LEVEL != null) TXT_VOLUME_LEVEL.setText(Integer.toString(nValue));
- else Log.w(TAG, "[showVolume] TXT_VOLUME_LEVEL is null!!");
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] showVolume(nValue)");
- }
- }
- private void drawVolume() {
- try {
- if (SEEKBAR_VOLUME != null) {
- SEEKBAR_VOLUME.setProgress(ctrlSeekBarThumb(nCurrentVolume));
- showVolume(nCurrentVolume);
- }
- else Log.w(TAG, "[drawVolume] SEEKBAR_VOLUME is null!!");
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] drawVolume()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- private int getCtrlLevel(int nValue) {
- try {
- // Log.d(TAG, "[getCtrlLevel] nValue: " + nValue);
- if (nValue == 0) return 1;
- int result = nValue / 10;
- if ((nValue % 10) != 0) result++;
- Log.d(TAG, "[getCtrlLevel] result: " + result);
- return result;
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- return 1;
- } catch (Exception e) {
- Log.e(TAG, "[Exception] getCtrlLevel(nValue)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- return 1;
- }
- }
- private int ctrlSeekBarThumb(int nValue) {
- try {
- int progress;
- if (nValue == 1) progress = 1;
- else if (nValue == 10) progress = 100;
- else progress = (nValue - 1) * 11;
- return progress;
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- return 1;
- } catch (Exception e) {
- Log.e(TAG, "[Exception] ctrlSeekBarThumb()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- return 1;
- }
- }
- private void ctrlWallPadMoIPVolume(int nValue) {
- try {
- LOG("[ctrlWallPadMoIPVolume] nValue [" + nValue + "]");
- Global.setV40WallPadVolume_RESIDENCE(nCurrentVolume);
- int nRemoteNum = -1;
- int nDeviceNm = -1;
- String sVol = "0x0000";
- for(int i = 0; i < strEndIP.length; i++)
- {
- if (ConfigValues.strDeviceIPaddress.equals(strEndIP[i])) {
- nDeviceNm = i; //0 1 2
- //break;
- }
- else if (RemoteIDInfo.strIP.equals(strEndIP[i])) {
- nRemoteNum = i; //3 4 5 6
- //break;
- }
- }
- if (nDeviceNm > -1 && nDeviceNm < 3)
- {
- if (nRemoteNum > -1 && nRemoteNum < 3)
- {
- sVol = "0x0170";
- }
- else if (nRemoteNum > 2 && nRemoteNum < 7)
- {
- sVol = "0x0300";
- }
- else
- sVol = "0x0300";
- }
- else if (nDeviceNm > 2 && nDeviceNm < 7)
- {
- if (nRemoteNum > -1 && nRemoteNum < 3)
- {
- sVol = "0x0300";
- }
- else if (nRemoteNum > 2 && nRemoteNum < 7)
- {
- sVol = "0x0300";
- }
- else
- sVol = "0x0300";
- }
- else
- sVol = "0x0300";
- Global.setV40WallPadMicGain(sVol);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] ctrlWallPadMoIPVolume(int nValue)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- public final class HANDLERMSG {
- public final static int PROC_ADDCALL = 100;
- public final static int PLAYMENT_BUSY_TRY_LATER = 110;
- public final static int FLICKER_LED_CALL = 160;
- public final static int REFRESH_BTNLED_STATUS = 170;
- public final static int ENABLE_PORTRAIT = 200;
- public final static int OFF_FRONT = 300;
- public final static int SET_VOLUME_TABLE = 400;
- }
- public Handler MainHandler = new Handler(Looper.getMainLooper()) {
- public void handleMessage(Message msg) {
- LOG("[MainHandler] MainHandler : what [" + msg.what + "], arg1 [" + msg.arg1 + "], arg2 [" + msg.arg2 + "]");
- switch (msg.what) {
- case HANDLERMSG.PROC_ADDCALL:
- procAddCall();
- break;
- case HANDLERMSG.PLAYMENT_BUSY_TRY_LATER:
- MainActivity.mSound.PlayMent(SND.call.BUSY_TRY_LATER);
- break;
- case HANDLERMSG.FLICKER_LED_CALL:
- ctrlCallLED();
- break;
- case HANDLERMSG.ENABLE_PORTRAIT:
- BTN_PORTRAIT.setButtonEventOffDisable();
- break;
- case HANDLERMSG.OFF_FRONT:
- playFrontCamBell(false);
- break;
- case HANDLERMSG.REFRESH_BTNLED_STATUS:
- setBTNLEDStatus();
- break;
- case HANDLERMSG.SET_VOLUME_TABLE:
- ctrlWallPadMoIPVolume(nCurrentVolume);
- break;
- default:
- break;
- }
- }
- };
- public void sendHandlerMsg(int what, int arg1, int arg2) {
- try {
- LOG("[sendHandlerMsg] what [" + what + "], arg1 [" + arg1 + "], arg2 [" + arg2 + "]");
- Message HandleMsg = MainHandler.obtainMessage();
- HandleMsg.what = what;
- HandleMsg.arg1 = arg1;
- HandleMsg.arg2 = arg2;
- MainHandler.sendMessage(HandleMsg);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] sendHandlerMsg(msg)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- public void sendHandlerMsgDelayed(int what, int arg1, int arg2, long delay) {
- try {
- LOG("[sendHandlerMsgDelayed] what [" + what + "], arg1 [" + arg1 + "], arg2 [" + arg2 + "], delay [" + delay + "]");
- Message HandleMsg = MainHandler.obtainMessage();
- HandleMsg.what = what;
- HandleMsg.arg1 = arg1;
- HandleMsg.arg2 = arg2;
- MainHandler.sendMessageDelayed(HandleMsg, delay);
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] sendHandlerMsgDelayed(msg)");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- int nCheckCnt = 0;
- protected Handler mPathCheckHandler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- // Log.d(TAG, "[mPathCheckHandler.handleMessage]");
- if (msg.what == 0) {
- nCheckCnt++;
- if (nCheckCnt > 200) {
- mPathCheckHandler.removeMessages(0);
- mPathCheckHandler.removeMessages(1);
- } else {
- if (MainActivity.mCallController.getTalkPath() == CALLPATH.MOIP_V40_RESIDENCE)
- mPathCheckHandler.sendEmptyMessageDelayed(1, 50);
- else mPathCheckHandler.sendEmptyMessageDelayed(0, 50);
- }
- } else if (msg.what == 1) {
- Log.d(TAG, "[mPathCheckHandler.handleMessage] Handler finish!! PATH [MOIP_V40_RESIDENCE]");
- sendHandlerMsg(HANDLERMSG.SET_VOLUME_TABLE, 0, 0);
- }
- }
- };
- private void finishWallpadCallApp() {
- try {
- doEnd();
- ((MainActivity) mContext).finishWallPadCall();
- } catch (RuntimeException re) {
- LogUtil.errorLogInfo("", TAG, re);
- } catch (Exception e) {
- Log.e(TAG, "[Exception] finishWallpadCallApp()");
- //e.printStackTrace();
- LogUtil.errorLogInfo("", TAG, e);
- }
- }
- }
|