C.47. SIPPEER()

SIPPEER(peername[,field])
Returns information about a SIP peer. The field may be one of:
ip
The IP address of the peer (default)
mailbox
The configured mailbox
context
The configured context
expire
The expiry time (in Unix time) for the connection.
dynamic
Whether or not dynamic is set (yes|no).
callerid_name
The configured CID name
callerid_num
The configured CID number
codecs
Available codecs
status
The status (when qualify=yes is set)
regexten
The registration extension
limit
Maximum number of calls
curcalls
Number of current calls (only if a limit is set)
language
The default language for this peer
useragent
The useragent of the peer
codec[x]
Preferred codec number x (beginning with 0)
accountcode
The billing account code in the CDR for conversations with this peer
; The IP address of peer 2001:
exten => 123,1,Set(sip_ip=${SIPPEER(2001,ip)})
; the preferred codec of the peer:
exten => 123,n,Set(sip_ip=${SIPPEER(2001,codec[0])})

Note

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

[Syntax]
SIPPEER(<peername>[|item])

[Synopsis]
Gets SIP peer information

[Description]
Valid items are:
- ip (default)          The IP address.
- 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.
- status                Status (if qualify=yes).
- regexten              Registration extension
- limit                 Call limit (call-limit)
- curcalls              Current amount of calls 
                        Only available if call-limit is set
- language              Default language for peer
- accountcode           Account code for this peer
- useragent             Current user agent id for peer
- codec[x]              Preferred codec index number 'x' (beginning with zero).
diff output to internal help in Asterisk 1.2:
5c5
< SIPPEER(<peername>[|item])
---
> SIPPEER(<peername>[:item])