> For the complete documentation index, see [llms.txt](https://docs.didforsale.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.didforsale.com/voice-and-sms-apis/voice-and-sms/getting-started/identify-caller.md).

# Identify Caller

## Identify Caller by Name

Now that you have successfully written your first Voice API, we will modify the code to make is more personalized we will include caller name in greeting.

*For example: “Hello Bob”*

```
<?php
 
       // contacts array will List everyone your contacts
            $contacts = array(    
              "9495797676"=>"John",
              "9495776878"=>"Lily",
              "3102168544"=>"Bob",
              "8587771234"=>"Wendy"
              "6058393817"=>"Amanda"
              );
        // if the caller is known, then greet them by name
        // otherwise, just identify them as another caller
        if(!$name = $contacts[$_REQUEST['From']])
                $name = "there";
 
        // now greet the caller
        header("content-type: text/xml");
        echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
        <Say>Hello <?php echo $name ?>.</Say>
</Response>
```

&#x20;In the code above we started off by creating an array $contact. In this array we have listed all the known contacts with their phone number and name. When the call comes in  *from* parameter will be triggered and look in the $contact array to see if we have the phone number in our contacts. If the phone number is located in the contacts then the code will greet the caller with name (*like Hello Bob)* else it will treat the caller unknown and respond “Hello There”.

***Key word used = Say***\
*Say Reads the text and convert’s that to audio and play to the caller.*

Wohooo!!!! You successfully completed the step and identified your caller by name!!!

Sounds good, now let's. Let's collect users response and so you can transfer call to the right person.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.didforsale.com/voice-and-sms-apis/voice-and-sms/getting-started/identify-caller.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
