|
63 | 63 | import static io.wazo.callkeep.Constants.ACTION_WAKE_APP;
|
64 | 64 | import static io.wazo.callkeep.Constants.EXTRA_CALLER_NAME;
|
65 | 65 | import static io.wazo.callkeep.Constants.EXTRA_CALL_NUMBER;
|
| 66 | +import static io.wazo.callkeep.Constants.EXTRA_CALL_NUMBER_SCHEMA; |
66 | 67 | import static io.wazo.callkeep.Constants.EXTRA_CALL_UUID;
|
67 | 68 | import static io.wazo.callkeep.Constants.EXTRA_DISABLE_ADD_CALL;
|
68 | 69 | import static io.wazo.callkeep.Constants.FOREGROUND_SERVICE_TYPE_MICROPHONE;
|
@@ -329,7 +330,21 @@ private Connection createConnection(ConnectionRequest request) {
|
329 | 330 |
|
330 | 331 | Bundle extras = request.getExtras();
|
331 | 332 | HashMap<String, String> extrasMap = this.bundleToMap(extras);
|
332 |
| - extrasMap.put(EXTRA_CALL_NUMBER, request.getAddress().toString()); |
| 333 | + |
| 334 | + String callerNumber = request.getAddress().toString(); |
| 335 | + if (callerNumber.contains(":")) { |
| 336 | + //CallerNumber contains a schema which we'll separate out |
| 337 | + int schemaIndex = callerNumber.indexOf(":"); |
| 338 | + String number = callerNumber.substring(schemaIndex + 1); |
| 339 | + String schema = callerNumber.substring(0, schemaIndex); |
| 340 | + |
| 341 | + extrasMap.put(EXTRA_CALL_NUMBER, number); |
| 342 | + extrasMap.put(EXTRA_CALL_NUMBER_SCHEMA, schema); |
| 343 | + } |
| 344 | + else { |
| 345 | + extrasMap.put(EXTRA_CALL_NUMBER, callerNumber); |
| 346 | + } |
| 347 | + |
333 | 348 | VoiceConnection connection = new VoiceConnection(this, extrasMap);
|
334 | 349 | connection.setConnectionCapabilities(Connection.CAPABILITY_MUTE | Connection.CAPABILITY_SUPPORT_HOLD);
|
335 | 350 |
|
|
0 commit comments