ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]
:toc: left
:toclevels: 5

= Phone

This module adds a phone.

== Extension

=== User

[source,lua]
----
self.phone_sms
self.cdata.phone_directory
self.phone_call -- source of correspondent if in phone call

-- send an sms to a phone number
-- return true on success
User:sendSMS(phone, msg)

-- add sms to phone
User:addSMS(phone, msg)

-- get directory name by number for a specific user
User:getPhoneDirectoryName(phone)

User:phoneHangUp()

-- call a phone number
-- return true if the communication is established
User:phoneCall(phone)

-- send smspos to a phone number
-- return true on success
User:sendSMSPos(phone, x,y,z)
----

=== Server

[source,lua]
----
self.cfg

-- Send a service alert to all service listeners
--- sender: user or nil (optional, if not nil, it is a call request alert)
--- service_name: service name
--- x,y,z: coordinates
--- msg: alert message
Phone:sendServiceAlert(sender,service_name,x,y,z,msg)
----

=== Client

[source,lua]
----
----

== Menu

=== phone

Phone menu.

=== phone.directory

Phone directory sub-menu.

=== phone.directory.entry

Phone directory entry sub-menu.

.data
[horizontal]
phone:: phone number

=== phone.sms

Phone sms sub-menu.

=== phone.service

Phone service sub-menu.

=== phone.announce

Phone announce sub-menu.
