Module interpret_backend

.

Introduced in: 03 Dec 2004 by Håkan Stenholm <hsten@it.su.se>

Authors: Håkan Stenholm (hsten@it.su.se).

Description

Function Index

'get_address-switch_field'/3 retrieves the value from a request that address-switch wants to switch on Note : only SIP URIs are supported.
'get_language-switch_value'/1 retrieve the languages supplied in the request sorted in q order Note : RFC 3066 handles language codes Note : sorting on q-value is mainly done here to support CPL extensions that can use q-values in a sensible manner (similar to RFC 2616 chapter 14.4) Note : "HTTP content negotiation (section 12) uses short "floating point" numbers to indicate the relative importance ("weight") of various negotiable parameters.
'get_priority-switch_value'/1 Get priority from initial INVITE "Priority" header.
'get_string-switch_field'/2 retrieve the specified field from Request.
add_location/4 Add a location, or if Clear is true replace all previous locations with this one.
address_or_address_part_contains/2 determine if Val from CPL script was part of value (ReqVal) in Request.
compare_address_or_address_part/2 determine if Val from CPL script matches value (ReqVal) in Request Note : only SIP URIs are supported Note : most ReqVal's originate from a sipurl record() that ensures proper case for the attributes, Val's on the other hand have to be converted as they are taken "as is" from a CPl script.
get_min_ring/0 the shortest time a "phone" may ring.
get_outgoing_destination/1
get_server_max/0 the maximum ring-time for this application.
in_time_range/2 determine if the time period specified by the TimeSwitchCond is currently occurring.
is_subdomain/2 check that ScriptVal matches the tail of ReqHostVal e.g.
language_matches/2 implements a single <Language matches = "..."> match according to RFC 3880 chapter 4.3 (see cpl/README for more details) Note : the prefix_match(...) code assumes that any "*" has been removed from ReqLangRanges.
log/3 log to some kind of storage (refered to as #log__attrs.name).
lookup/4 Note : XXX Timeout isn't used, should result in {failure, ...}.
mail/2 send a mail, by using a callback module 'cpl_mail_callback' defined in local.erl, default behavior (when no callback has been supplied) is to do nothing.
priority_equal/2
priority_greater/2
priority_less/2
rm_location/2 remove (all) entries of URIStr from Locations Note : this version only supports SIP URIs.
string_contains/2 Check if Val is a string of ReqVal.
string_is/2 Check if Val is same as ReqVal.

Function Details

'get_address-switch_field'/3

'get_address-switch_field'(Request, Field, SubField) -> #sipurl{} | {Field, Val} | '#no_value'

retrieves the value from a request that address-switch wants to switch on Note : only SIP URIs are supported

'get_language-switch_value'/1

'get_language-switch_value'(Request) -> '#no_value' | [string()]

returns: the language codes

retrieve the languages supplied in the request sorted in q order Note : RFC 3066 handles language codes Note : sorting on q-value is mainly done here to support CPL extensions that can use q-values in a sensible manner (similar to RFC 2616 chapter 14.4) Note : "HTTP content negotiation (section 12) uses short "floating point" numbers to indicate the relative importance ("weight") of various negotiable parameters. A weight is normalized to a real number in the range

'get_priority-switch_value'/1

'get_priority-switch_value'(Request) -> normal | emergency | urgent | 'non-urgent' | {unknown, PrioStr}

Get priority from initial INVITE "Priority" header.

'get_string-switch_field'/2

'get_string-switch_field'(Request, Field) -> Res

retrieve the specified field from Request

add_location/4

add_location(Locations, URIstr, Prio, Clear) -> [#location{}]

Add a location, or if Clear is true replace all previous locations with this one. Note : this version only supports SIP URIs

address_or_address_part_contains/2

address_or_address_part_contains(X1::ReqVal, Val) -> true | false

determine if Val from CPL script was part of value (ReqVal) in Request

compare_address_or_address_part/2

compare_address_or_address_part(ReqVal, Val) -> true | false

determine if Val from CPL script matches value (ReqVal) in Request Note : only SIP URIs are supported Note : most ReqVal's originate from a sipurl record() that ensures proper case for the attributes, Val's on the other hand have to be converted as they are taken "as is" from a CPl script

get_min_ring/0

get_min_ring() -> integer()

returns: the number of seconds

the shortest time a "phone" may ring

get_outgoing_destination/1

get_outgoing_destination() -> term()

get_server_max/0

get_server_max() -> integer()

returns: the number of seconds

the maximum ring-time for this application

in_time_range/2

in_time_range(Timezone, TimeSwitchCond) -> true | false

determine if the time period specified by the TimeSwitchCond is currently occurring

is_subdomain/2

is_subdomain(ReqHostVal, ScriptVal) -> true | false

check that ScriptVal matches the tail of ReqHostVal e.g. that "bar.com" is part of "foo.bar.com". is_subdomain/2 checks that SubStr is well formed i.e. is_subdomain("foo.bar.com","ar.com") would return false Note : IP addresses can be passed to this function but are only compared for equality (see RFC 3880 chapter 4.1 p10), domain names on the other hand support full subdomain checking.

language_matches/2

language_matches(R::ReqLangRanges, ScriptLangTag) -> true | false

implements a single <Language matches = "..."> match according to RFC 3880 chapter 4.3 (see cpl/README for more details) Note : the prefix_match(...) code assumes that any "*" has been removed from ReqLangRanges

log/3

log(Log__attrs::LogAttrs, User, Request) -> term()

log to some kind of storage (refered to as #log__attrs.name)

lookup/4

lookup(X1::Source, User, URI, Timeout) -> {Result, Locs}

Note : XXX Timeout isn't used, should result in {failure, ...}

mail/2

mail(Mail, User) -> term()

send a mail, by using a callback module 'cpl_mail_callback' defined in local.erl, default behavior (when no callback has been supplied) is to do nothing. The callback function CallBackModule:mail/2 takes the same arguments as this function

priority_equal/2

priority_equal() -> term()

priority_greater/2

priority_greater() -> term()

priority_less/2

priority_less() -> term()

rm_location/2

rm_location(Locations, URIStr) -> [#location{}]

remove (all) entries of URIStr from Locations Note : this version only supports SIP URIs

string_contains/2

string_contains(ReqVal, Val) -> true | false

Check if Val is a string of ReqVal. Note : "Strings are matched as case-insensitive Unicode strings, in the following manner. First, strings are canonicalized to the "Compatibility Composition" (KC) form, as specified in Unicode Standard Annex #15 [5]. Then, strings are compared using locale- insensitive caseless mapping, as specified in Unicode Standard Annex #21 [6]." - RFC 3880 chapter 4.2 p12 XXX this code only does a byte by byte compare with latin-1 chars

string_is/2

string_is(ReqVal, Val) -> true | false

Check if Val is same as ReqVal. Note : "Strings are matched as case-insensitive Unicode strings, in the following manner. First, strings are canonicalized to the "Compatibility Composition" (KC) form, as specified in Unicode Standard Annex #15 [5]. Then, strings are compared using locale- insensitive caseless mapping, as specified in Unicode Standard Annex #21 [6]." - RFC 3880 chapter 4.2 p12 XXX this code only does a byte by byte compare with latin-1 chars


Generated by EDoc, Oct 17 2007, 16:48:06.