如何获取星号中特定对等体的联系URI?

时间:2015-10-30 12:13:07

标签: asterisk sip

我想从diaplan获取星号中特定对等体的联系URI。我有两个对等体2001和2001我想要两个对等体的联系URI我怎么能得到这个?

1 个答案:

答案 0 :(得分:1)

您可以使用SIP_HEADER函数获取任何SIP标题(包括联系ofcz)。

h2*CLI> core show function SIP_HEADER 

  -= Info about function 'SIP_HEADER' =- 

[Synopsis]
Gets the specified SIP header from an incoming INVITE message. 

[Description]
Since there are several headers (such as Via) which can occur multiple times,
SIP_HEADER takes an optional second argument to specify which header with
that name to retrieve. Headers start at offset '1'.

[Syntax]
SIP_HEADER(name[,number])

[Arguments]
number
    If not specified, defaults to '1'.

[See Also]
Not available

但是它会提供INVITE字段的联系,而不是注册信息。您可以获取SIPPEER功能以获取对等信息。

h2*CLI> core show function SIPPEER 

  -= Info about function 'SIPPEER' =- 

[Synopsis]
Gets SIP peer information. 

[Description]
Not available

[Syntax]
SIPPEER(peername[,item])

[Arguments]
item
    ip - (default) The ip address.
    port - The port number.
    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.
    callgroup - The configured Callgroup.
    pickupgroup - The configured Pickupgroup.
    codecs - The configured codecs.
    status - Status (if qualify=yes).
    regexten - Registration extension.
    limit - Call limit (call-limit).
    busylevel - Configured call level for signalling busy.
    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.
    maxforwards - The value used for SIP loop prevention in outbound
    requests
    chanvar[name] - A channel variable configured with setvar for this
    peer.
    codec[x] - Preferred codec index number <x> (beginning with
    zero).

[See Also]
Not available