遭遇:
遇到這樣一個問題:
使用GSM卡,撥打112時提示各種緊急號碼作用……
使用CMDA卡,撥打112時提示撥打的號碼是空號??
這讓我有點不知所以然,網上找到下面這篇文章,說的很詳細,轉載了。
問題描述
緊急號碼在過去的幾個項目的開發中一直是難下定論的一項問題,原因在於針對不同CP平台,不同制式的資料網路,不同的電訊廠商,都有不同的緊急號碼,
而且在無SIM卡情況下緊急號碼是否能撥出也並無定論。
常用的緊急號碼中:
911是北美大陸通用警示電話。
08和112是全世界GSM通訊網路共同的標準緊急電話
110,119,120,122是國內大陸的匪、火、急救、交通緊急號碼
118是歐洲部分地區的警示求救電話
999是紅十字會的警示電話
000是港澳地區的警示電話
印度緊急號碼支援:
100 police
112,108 medical
101 file
其中,112與911作為預設的緊急號碼,是被寫入ril.rcclist中。而其它幾個緊急號碼並未加入其中,需要自行寫入該設定檔,
同時modem側需要為其開通特定的緊急號碼撥號通路。
關於需求給出的手機緊急號碼的最終需求定義如下(高通平台):
關於“緊急電話”問題,總結下,僅限高通平台:
1. CDMA網路
(1)無卡情況下
119/999/120/110均被直接拒絕,無法完成呼叫;
特例:撥打112/911,視各地網路不同而不同,
有的地方cdma網路會不支援,但高通的DSDS方案,會自動切換到GSM網路下完成112呼叫(如:北京);
有的地方的CDMA網路可以完成呼叫(如:廈門);
(2)插卡情況下
119/999/120/110/119,均按照普通撥打電話成功,包括欠費情況下仍然能呼叫成功;
112 會撥到聯通112障礙台
911 提示為空白號
2. wcdma網路+GSM網路
(1)無卡情況下
999/120/110/119,均被拒絕
112/911會轉到障礙台;
(2)插卡情況下
999/120/110/119,按照正常撥打電話成功,包括欠費情況下仍然能撥打成功
112/911,會轉到障礙台;
關於緊急號碼(補1)
國內的緊急號碼在不插sim卡的情況下,實際上都無法打到人工台。這是由於國內並不存在“可以撥打”的緊急號碼。
通常意義上的緊急號碼應該獨立於電訊廠商存在,也就是不依賴於SIM卡。但是這種情況在國內是顯然不行的,即使在modem側進行處理,讓110、119這類的號碼走緊急通話的通道,仍然只能打到障礙台。
至於為什麼平時撥打緊急號碼可以成功,這是因為插著sim卡的時候,並不是走緊急撥號的通道,只是一路普通的呼出電話而已。
解決辦法
在處理該問題的過程中,往往rcclist列表都無法直接修改,而且,framework側並不是最終決定該緊急號碼是否能夠撥出去的決定因素(如果該緊急號碼並未加入modem平台側緊急號碼的列表中,該號碼依然無法撥出),所
以解決該問題一勞永逸的方法是,在framework側直接將需求所定下來的緊急號碼寫為固定的緊急號碼,不做過濾處理,都交由Modem側來判決。
目前項目對緊急號碼的支援為:
(高通,G/W)
預置的緊急號碼包括:110、112、911、000、08、999、118、119。
(英飛淩,G/EVDO)
預置的緊急號碼包括:110、112、911、999、119、120。
暫時的解決辦法可以是:
可以在 android/telephony/PhoneNumberUtils.java 中進行修改:
private static boolean isEmergencyNumberInternal(String number, boolean useExactMatch) { // If the number passed in is null, just return false: if (number == null) return false; // If the number passed in is a SIP address, return false, since the // concept of "emergency numbers" is only meaningful for calls placed // over the cell network. // (Be sure to do this check *before* calling extractNetworkPortionAlt(), // since the whole point of extractNetworkPortionAlt() is to filter out // any non-dialable characters (which would turn 'abc911def@example.com' // into '911', for example.)) if (isUriNumber(number)) { return false; } // Strip the separators from the number before comparing it // to the list. number = extractNetworkPortionAlt(number); /* // retrieve the list of emergency numbers // check read-write ecclist property first String numbers = SystemProperties.get("ril.ecclist"); if (TextUtils.isEmpty(numbers)) { // then read-only ecclist property since old RIL only uses this numbers = SystemProperties.get("ro.ril.ecclist"); } if (!TextUtils.isEmpty(numbers)) { // searches through the comma-separated list for a match, // return true if one is found. for (String emergencyNum : numbers.split(",")) { if (useExactMatch) { if (number.equals(emergencyNum)) { return true; } } else { if (number.startsWith(emergencyNum)) { return true; } } } // no matches found against the list! return false; } */ // No ecclist system property, so use our own list. if (useExactMatch) { return (number.equals("112") || number.equals("08") || //北美大陸通用警示 number.equals("911") || //國內大陸緊急號碼 number.equals("110") || number.equals("119") || number.equals("120") || number.equals("122") || //港澳地區警示 number.equals("000") || //印度地區專用 number.equals("100") || number.equals("108") || number.equals("101") || //紅十字會 number.equals("999") || //歐洲部分地區警示 number.equals("118")); } else { return (number.startsWith("112") || number.startsWith("08") || //北美大陸通用警示 number.startsWith("911") || //國內大陸緊急號碼 number.startsWith("110") || number.startsWith("119") || number.startsWith("120") || number.startsWith("122") || //港澳地區警示 number.startsWith("000") || //印度地區專用 number.startsWith("100") || number.startsWith("108") || number.startsWith("101") || //紅十字會 number.startsWith("999") || //歐洲部分地區警示 number.startsWith("118")); //changed by weiyi } }
注釋掉對應的過濾段,添加結果即可。
轉載:http://blog.csdn.net/guiyu_1985/article/details/8454413