Skip to content

Commit f040b55

Browse files
committed
Update readme
1 parent 600131e commit f040b55

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,23 @@ Caller is usually referred to as `call.from` or `callInvite.from`. This can eith
332332

333333
The following rules are applied to determine the caller/recipient name, which is shown in the call screen and heads-up notification:
334334

335-
- If the caller is empty/not provided, the default caller name is shown e.g. "Unknown Caller", else
336-
- if the caller is a number, the plugin will show the number as is, else
337-
- if the caller is a string, the plugin will interpret the string as follows:
338-
- if the `__TWI_CALLER_NAME` parameter is provided, the plugin will show the value of `__TWI_CALLER_NAME` as is, else
339-
- if the `__TWI_CALLER_ID` parameter is provided, the plugin will search for a registered client with the same id and show the client name, else
340-
- if not found or not provided, the plugin will search for a registered client with the `call.from` value and show the client name, as a last resort
335+
##### Incoming Calls:
336+
337+
`__TWI_CALLER_NAME` -> `resolve(__TWI_CALLER_ID)` -> (phone number) -> `registered client (from)` -> `defaultCaller name` -> `"Unknown Caller"`
338+
339+
340+
##### Outgoing Calls:
341+
342+
`__TWI_RECIPIENT_NAME` -> `resolve(__TWI_RECIPIENT_ID)` -> (phone number) -> `registered client (to)` -> `defaultCaller name` -> `"Unknown Caller"`
343+
344+
**Details explaination:**
345+
346+
- if the call is an CallInvite (incoming), the plugin will interpret the string as follows or if the call is outgoing, the twilio `To` parameter field is used to:
347+
- if the `__TWI_CALLER_NAME` (or `__TWI_RECIPIENT_NAME`) parameter is provided, the plugin will show the value of `__TWI_CALLER_NAME` (or `__TWI_RECIPIENT_NAME`) as is, else
348+
- if the `__TWI_CALLER_ID` (or `__TWI_RECIPIENT_ID`) parameter is provided, the plugin will search for a registered client with the same id and show the client name,
349+
- if the caller (`from` or `to` fields) is empty/not provided, the default caller name is shown e.g. "Unknown Caller", else
350+
- else if the caller (`from` or `to` fields) is a number, the plugin will show the number as is, else
351+
- else the plugin will search for a registered client with the `callInvite.from` (or call.to) value and show the client name, as a last resort
341352
- the default caller name is shown e.g. "Unknown Caller"
342353

343354
*Please note: the same approach applies to both caller and recipient name resolution.*

0 commit comments

Comments
 (0)