Metadata Fields

October 27, 2015 ยท View on GitHub

NkSIP allows the retrieval of specific information from requests, reponses, dialogs and subscriptions. The available options are defined here for:

Keep in mind that activated plugins can install aditional metadata fields. See the plugins documentation.

Request and Responses Metadata

Accesible when calling nksip_request:meta/2, nksip_response:meta/2 and when using the option meta in the requests sending functions.

NameTypeDescription
handlenksip:handle()Request or response's handle
srv_idnksip:srv_id()Internal Service name this request or response belongs to
srv_nameterm()User Service name this request or response belongs to
dialog_handlenksip:handle()Dialog's handle of this request or response
subscription_handlenksip_id()Subscription's handle of this request or response
protonksip:protocol()Transport protocol
local{nksip:protocol(),inet:ip_address(),inet:port_number()}Local transport protocol, ip and port
remote{nksip:protocol(),inet:ip_address(),inet:port_number()}Remote transport protocol, ip and port
methodnksip:method()Method of the request (undefined if it is a response)
rurinksip:uri()RUri of the request
schemenksip:scheme()Scheme of RUri
userbinary()User of RUri
domainbinary()Domain of RUri
aornksip:aor()Address-Of-Record of the RUri
codenksip:sip_code()SIP Code of the response (0 if it as request)
reason_phrasebinary()Reason Phrase of the response
content_typenksip:token()Content-Type header
bodynksip:body()Body
call_idnksip:call_id()Call-ID header
vias[nksip:via()]Via headers
fromnksip:uri()From header
from_tagnksip:tag()From tag
from_schemenksip:scheme()From SIP scheme
from_userbinary()From user
from_domainbinary()From domain
tonksip:uri()To header
to_tagnksip:tag()To tag
to_schemenksip:scheme()To SIP scheme
to_userbinary()To user
to_domainbinary()To domain
cseq_numinteger()CSeq (numeric part)
cseq_methodnksip:method()CSeq (method part)
forwardsinteger()Max-Forwards header
routes[nksip:uri()]Route headers
contacts[nksip:uri()]Contact headers
require[binary()]Tokens in Require header
supported[binary()]Tokens in Supported header
expiresinteger()|undefinedExpires header
expiredboolean()trueif the request has expired (looking at Expires and Date headers, or received date if missing)
eventnksip:token()|undefinedToken in Event header
retry_afterinteger()|undefined|errorRetry-After header
refer_tonksip:uri()|errorURL in Refer-To header
realms[binary()]Realms in authentication headers
rseq_numinteger()|undefinedRSeq header (numeric part)
rack{integer(),integer(),nksip:method()}|undefinedRAck header
{header, Name}[binary()]Gets an unparsed header value
all_headers[{binary(),[binary()]}]Gets all headers and values

Besides this values, you can use any string() or binary() to the get that header's value (use allways lowercase).

Dialogs Metadata

Available when calling nksip_dialog:meta/2.

NameTypeDescription
handlenksip:handle()Dialog's handle
srv_idnksip:srv_id()Internal Service name this dialog belongs to
srv_nameterm()User Service name this dialog belongs to
creatednksip_lib:timestamp()Creation date
updatednksip_lib:timestamp()Last update
local_seqinteger()Local CSeq number
remote_seqinteger()Remote CSeq number
local_urinksip:uri()Local URI
raw_local_uribinary()Unparsed Local URI
remote_urinksip:uri()Remote URI
raw_remote_uribinary()Unparsed Remote URI
local_targetnksip:uri()Local Target URI
raw_local_targetbinary()Unparsed Local Target URI
remote_targetnksip:uri()Remote Target URI
raw_remote_targetbinary()Unparsed Remote Target URi
earlyboolean()Early dialog (no final response yet)
secureboolean()Secure (sips) dialog
route_setnksip:uri()}Route Set
raw_route_setbinary()Unparsed Route Set
invite_statusnksip_dialog:status()Current dialog's INVITE status
invite_answerednksip_lib:timestamp()}Answer (first 2xx response) timestamp for INVITE usages
invite_local_sdpnksip:sdp()}Current local SDP
invite_remote_sdpnksip:sdp()}Current remote SDP
invite_timeoutinteger()Seconds to expire current state
subscriptionsnksip:handle()Lists all active subscriptions
call_idnksip:call_id()Call-ID of the dialog
from_tagbinary()From tag
to_tagbinary()To tag

Subscriptions Metadata

Available when calling nksip_subscriptions:meta/2. All dialog options are available for subscriptions, and also:

NameTypeDescription
handlenksip:handle()Subscription's Id
statusnksip_subscription:status()Subscription's current status
eventnksip:token()Event header
raw_eventbinary()Unparsed Event header
classuac|uasClass of the event, as a UAC or a UAS
answerednksip_lib:timestamp()|undefinedTime first NOTIFY was received
expiresinteger()Seconds reamaining to subscription expiration