C.26. IAXPEER()

IAXPEER(peername[:field])
Returns information about an IAX peer. The peername can be replaced with CURRENTCHANNEL to specify the current channel. The field is one of the following:
ip
(default) the IP address of the peer
status
Peer status (when qualify=yes)
mailbox
The configured mailbox
context
The configured context
expire
The expiry time (in Unix time) for the connection
dynamic
Whether the connection is dynamic or not (yes|no).
callerid_name
The configured CID name
callerid_num
The configured CID number
codecs
The accessible codecs
codec[x]
Preferred codec number x (beginning with 0)
; Query the IP address of peer1:
exten => 123,1,Set(foo=${IAXPEER(peer1:ip)})

Note

Internal help for this application in Asterisk 1.4:
  -= Info about function 'IAXPEER' =- 

[Syntax]
IAXPEER(<peername|CURRENTCHANNEL>[|item])

[Synopsis]
Gets IAX peer information

[Description]
If peername specified, valid items are:
- ip (default)          The IP address.
- status                The peer's status (if qualify=yes)
- mailbox               The configured mailbox.
- context               The configured context.
- expire                The epoch time of the next expire.
- dynamic               Is it dynamic? (yes/no).
- callerid_name         The configured Caller ID name.
- callerid_num          The configured Caller ID number.
- codecs                The configured codecs.
- codec[x]              Preferred codec index number 'x' (beginning with zero).

If CURRENTCHANNEL specified, returns IP address of current channel
diff output to internal help in Asterisk 1.2:
5c5
< IAXPEER(<peername|CURRENTCHANNEL>[|item])
---
> IAXPEER(<peername|CURRENTCHANNEL>[:item])