> ## Documentation Index
> Fetch the complete documentation index at: https://superofficeas-worktree-351-fix-webapi-escaped-anchors.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Register an incoming call

> How to register an incoming call with CRMScript

The **activity type** for phone calls is 5. By default, the direction is *incoming*.

This example code will register an incoming call with a description, starting now, and lasting 10 minutes.

```crmscript theme={null}
DateTime start;
DateTime end;
end.addMin(10);

NSAppointmentAgent appointmentAgent;
NSAppointmentEntity incomingCall = appointmentAgent.CreateDefaultAppointmentEntityByTypeAndAssociate(5, 1);

incomingCall.SetActiveDate(start);
incomingCall.SetStartDate(start);
incomingCall.SetEndDate(end);
incomingCall.SetDescription("My favorite customer calling re migration.");

incomingCall = appointmentAgent.SaveAppointmentEntity(incomingCall);
```

## Related topics

* [NSAppointmentAgent][1]
* [NSAppointmentEntity][2]
* [About phone calls][3]

[1]: /en/automation/crmscript/reference/CRMScript.NetServer.NSAppointmentAgent

[2]: /en/automation/crmscript/reference/CRMScript.NetServer.NSAppointmentEntity

[3]: ../../../../diary/learn/follow-ups#call
