Documentation

Documentation.Script-CoreFunctions-3-4 History

Hide minor edits - Show changes to markup

April 03, 2024, at 02:47 PM by 109.99.227.30 -
Changed line 734 from:
to:

August 28, 2023, at 06:17 PM by razvancrainea -
Changed lines 988-989 from:

check_blacklist([bl_name], ip[, port [, proto]]) 🔗

to:

check_blacklist_rule([bl_name], ip[, port [, proto]]) 🔗

October 28, 2022, at 04:55 PM by razvancrainea -
Added lines 986-1035:

@]

check_blacklist([bl_name], ip[, port [, proto]]) 🔗

Checks whether a specific proto:ip:port+pattern matches a blacklist, or all if bl_name is not specified.

Parameters:

  • bl_name (string, optional) - if missing, the rule is matched against all used blacklists
  • ip (string) - the IP to check against
  • port (integer, optional) - the port to check against; if missing, 0 is considered, which will match only 0-port rules
  • proto (string, optional) - the protocol to check against, or "any" if any protocol should be checked; if missing, "any" is considered, which will match only any proto rules
  • pattern (string, optional) - the pattern to check against
    if (check_blacklist("pstn-gws", $dd, $dp, $dP))
        xlog("REQUEST will be blocked\n");

add_blacklist_rule([bl_name], ip[, port [, proto [, expire]]]) 🔗

Adds a proto:ip:port+pattern rule to a blacklist.

Parameters:

  • bl_name (string) - the blacklist to add the rule to
  • ip (string) - the IP to add; if the IP starts with '!', the entire rule is negated
  • port (integer, optional) - the port to add; if missing, 0/any port is used
  • proto (string, optional) - the protocol to add, or "any" for any protocol; if missing, "any" is used
  • pattern (string, optional) - the pattern to add
  • expire (integer, optional) - if specified, provides the expiration time in seconds for the rule
    add_blacklist_rule("filter", $si, $sp, "udp");

del_blacklist_rule([bl_name], ip[, port [, proto]]) 🔗

Removes a proto:ip:port+pattern rule from a blacklist.

Parameters:

  • bl_name (string) - the blacklist to remove the rule from
  • ip (string) - the IP to remove; if the IP starts with '!', the entire rule is negated
  • port (integer, optional) - the port to remove; if missing, 0/any port is used
  • proto (string, optional) - the protocol to remove, or "any" for any protocol; if missing, "any" is used
  • pattern (string, optional) - the pattern to remove

[@

    del_blacklist_rule("filter", $si, $sp, "udp");
February 09, 2022, at 10:31 AM by 109.99.227.30 -
Changed lines 884-885 from:

st_check_status( group, [identifier]) 🔗

to:

sr_check_status( group, [identifier]) 🔗

Changed lines 896-898 from:
  • (1) the status of the given identifier
  • (2) the status of the "main" identifier
  • (3) the aggregated status over all identifiers, as -1 (if at least of identifier has a negative status) or 1 (if all identifiers have a positive status)
to:
  • (1) the status of the given identifier
  • (2) the status of the "main" identifier
  • (3) the aggregated status over all identifiers, as -1 (if at least of identifier has a negative status) or 1 (if all identifiers have a positive status)
February 09, 2022, at 10:30 AM by 109.99.227.30 -
Changed lines 883-887 from:

strip(n) 🔗

Strip the first N-th characters from username of R-URI (N is the value of the parameter).

to:

st_check_status( group, [identifier]) 🔗

Function to check the status of an 'status/report' identifier. Such checking is very useful for determining at script level the readiness of a module or core component (if able to provide its full functionality).

Changed lines 889-890 from:
  • n (int)
to:
  • group (string), the name of the 'status/report' group (the group exported by the OpenSIPS core is named "core", while the modules may export groups with their names.
  • identifier (string, optional), the name of the identifier to be checked (what are the available identifiers, it depends on the party exporting the group). Possible values for this identifier are:
    • (1) name of an identifier
    • (2) NULL, to refer to the default (per group) identifier (converted internally into "main" identifier
    • (3) "all" to refer to all the identifiers in the group

The returned value, depending on the provided identifier value, may be:

  • (1) the status of the given identifier
  • (2) the status of the "main" identifier
  • (3) the aggregated status over all identifiers, as -1 (if at least of identifier has a negative status) or 1 (if all identifiers have a positive status)
Added lines 902-921:
    # check if the "pstn" identifier (the "pstn" partition) from "drouting" module is ready (data is fully loaded)
    if (st_check_status( "drouting", "pstn") ) {}

    # check if the all identifiers (all partitions) from "drouting" module are ready (data is fully loaded)
    if (st_check_status( "drouting", "all") ) {}

strip(n) 🔗

Strip the first N-th characters from username of R-URI (N is the value of the parameter).

Parameters:

  • n (int)

Example of usage:

[@

Added line 923:

@]

December 17, 2021, at 07:39 PM by 109.99.227.30 -
Changed lines 16-17 from:

add_local_rport()

to:

add_local_rport() 🔗

Changed lines 25-26 from:

assert()

to:

assert() 🔗

Changed lines 35-36 from:

append_branch([uri], [qvalue])

to:

append_branch([uri], [qvalue]) 🔗

Changed lines 100-101 from:

cache_store(storage_id, attribute, value, [timeout])

to:

cache_store(storage_id, attribute, value, [timeout]) 🔗

Changed lines 126-127 from:

cache_remove(storage_id, attribute)

to:

cache_remove(storage_id, attribute) 🔗

Changed lines 148-149 from:

cache_fetch(storage_id, attribute, result)

to:

cache_fetch(storage_id, attribute, result) 🔗

Changed lines 172-173 from:

cache_counter_fetch(storage_id, counter_attribute, result)

to:

cache_counter_fetch(storage_id, counter_attribute, result) 🔗

Changed lines 195-196 from:

cache_add( storage_id, attribute, increment, expire, [new_val])

to:

cache_add( storage_id, attribute, increment, expire, [new_val]) 🔗

Changed lines 218-219 from:

cache_sub(storage_id, attribute, decrement, expire, [new_val])

to:

cache_sub(storage_id, attribute, decrement, expire, [new_val]) 🔗

Changed lines 241-242 from:

cache_raw_query(storage_id, raw_query, result)

to:

cache_raw_query(storage_id, raw_query, result) 🔗

Changed lines 261-262 from:

break()

to:

break() 🔗

Changed lines 268-269 from:

construct_uri(proto,[user],domain,[port],[extra],result)

to:

construct_uri(proto,[user],domain,[port],[extra],result) 🔗

Changed lines 287-288 from:

drop()

to:

drop() 🔗

Changed lines 304-305 from:

exit()

to:

exit() 🔗

Changed lines 328-329 from:

force_rport()

to:

force_rport() 🔗

Changed lines 338-339 from:

force_send_socket(proto:address[:port])

to:

force_send_socket(proto:address[:port]) 🔗

Changed lines 351-352 from:

force_tcp_alias([port_alias])

to:

force_tcp_alias([port_alias]) 🔗

Changed lines 363-364 from:

forward(destination)

to:

forward(destination) 🔗

Changed lines 378-379 from:

get_timestamp(sec_avp,usec_avp)

to:

get_timestamp(sec_avp,usec_avp) 🔗

Changed lines 392-393 from:

isdsturiset()

to:

isdsturiset() 🔗

Changed lines 403-404 from:

isflagset(string)

to:

isflagset(string) 🔗

Changed lines 420-421 from:

isbflagset(flag, [branch_idx])

to:

isbflagset(flag, [branch_idx]) 🔗

Changed lines 438-439 from:

is_myself(host, [port])

to:

is_myself(host, [port]) 🔗

Changed lines 452-453 from:

log([level,] string)

to:

log([level,] string) 🔗

Changed lines 462-463 from:

next_branches()

to:

next_branches() 🔗

Changed lines 474-475 from:

prefix(str)

to:

prefix(str) 🔗

Changed lines 486-487 from:

pv_printf(pv, fmt_str)

to:

pv_printf(pv, fmt_str) 🔗

Changed lines 501-502 from:

raise_event(event, [attrs], [vals])

to:

raise_event(event, [attrs], [vals]) 🔗

Changed lines 537-538 from:

remove_branch(branch_idx)

to:

remove_branch(branch_idx) 🔗

Changed lines 561-562 from:

return(int)

to:

return(int) 🔗

Changed lines 597-598 from:

resetdsturi()

to:

resetdsturi() 🔗

Changed lines 606-607 from:

resetflag(flag)

to:

resetflag(flag) 🔗

Changed lines 622-623 from:

resetbflag(flag, [branch_idx])

to:

resetbflag(flag, [branch_idx]) 🔗

Changed lines 640-641 from:

revert_uri()

to:

revert_uri() 🔗

Changed lines 649-650 from:

sethost(host)

to:

sethost(host) 🔗

Changed lines 661-662 from:

sethostport(hostport)

to:

sethostport(hostport) 🔗

Changed lines 673-674 from:

setuser(user)

to:

setuser(user) 🔗

Changed lines 685-686 from:

setuserpass(pass)

to:

setuserpass(pass) 🔗

Changed lines 697-698 from:

setport(port)

to:

setport(port) 🔗

Changed lines 709-710 from:

seturi(str)

to:

seturi(str) 🔗

Changed lines 721-722 from:

route(name [, param1 [, param2 [, ...] ] ] )

to:

# route

route(name [, param1 [, param2 [, ...] ] ] ) 🔗

Changed lines 734-735 from:

script_trace([log_level, pv_format_string, [info]])

to:

# script_trace

script_trace([log_level, pv_format_string, [info]]) 🔗

Changed lines 767-768 from:

send(destination [, headers])

to:

send(destination [, headers]) 🔗

Changed lines 783-784 from:

serialize_branches(clear_previous[, keep_order])

to:

serialize_branches(clear_previous[, keep_order]) 🔗

Changed lines 813-814 from:

set_advertised_address(adv_addr)

to:

set_advertised_address(adv_addr) 🔗

Changed lines 825-826 from:

set_advertised_port(adv_port)

to:

set_advertised_port(adv_port) 🔗

Changed lines 837-838 from:

setdsturi(uri)

to:

setdsturi(uri) 🔗

Changed lines 849-850 from:

setflag(flag)

to:

setflag(flag) 🔗

Changed lines 864-865 from:

setbflag(flag, [branch_idx])

to:

setbflag(flag, [branch_idx]) 🔗

Changed lines 883-884 from:

strip(n)

to:

strip(n) 🔗

Changed lines 895-896 from:

strip_tail(n)

to:

strip_tail(n) 🔗

Changed lines 908-909 from:

subscribe_event(string, string [, int])

to:

subscribe_event(string, string [, int]) 🔗

Changed lines 934-935 from:

use_blacklist(bl_name)

to:

use_blacklist(bl_name) 🔗

Changed lines 946-947 from:

unuse_blacklist(bl_name)

to:

unuse_blacklist(bl_name) 🔗

Changed lines 958-959 from:

xlog([log_level, ]format_string)

to:

xlog([log_level, ]format_string) 🔗

Changed line 977 from:

@]

to:

@]

September 01, 2021, at 10:20 AM by liviu -
Changed lines 145-148 from:

This function fetches from a memory-cache-like storage system the value of an attribute. The result (if any) will be stored in the variable specified by result.

Function returns true if the attribute was found and its value returned.

to:

Fetch the value of an attribute from a memory-cache-like storage system. On a successful fetch, the result will be stored in the variable specified by result_pv.

Function returns true if the attribute was found and its value successfully returned.

Changed line 152 from:
  • result (var)
to:
  • result_pv (var)
July 08, 2021, at 01:19 PM by liviu -
Changed line 742 from:

Takes all currently added branches for parallel forking (with append_branch()), as well as the current branch: (R-URI ($ru) / outbound Proxy ($du) / q value ($ru_q) / branch flags / forced Path headers / forced send socket), and prepares them for serial forking instead. The ordering is done in decreasing "q" order. The serialized branches are internally stored in the "$avp(serial_branch)" AVP - this allows them to be manipulated by the "next_branches()" function, usually within a failure route.

to:

Takes all currently added branches for parallel forking (e.g. with lookup() or append_branch()), as well as the current branch (R-URI ($ru) / outbound Proxy ($du) / q value ($ru_q) / branch flags / forced Path headers / forced send socket), and prepares them for serial forking instead. The ordering is done in decreasing "q" order. The serialized branches are internally stored in the "$avp(serial_branch)" AVP - this allows them to be manipulated by the "next_branches()" function, usually within a failure route.

June 14, 2021, at 01:30 PM by razvancrainea -
Deleted lines 621-622:

Note that the rewritehost alias for this function has been removed.

Deleted lines 632-633:

Note that the rewritehostport alias for this function has been removed.

Deleted lines 643-644:

Note that the rewriteuser alias for this function has been removed.

Deleted lines 654-655:

Note that the rewriteuserpass alias for this function has been removed.

Deleted lines 665-666:

Note that the rewriteport alias for this function has been removed.

Deleted lines 675-676:

Note that the rewriteuri alias for this function has been removed.

August 07, 2020, at 08:33 PM by rvlad_patrascu -
Changed lines 234-235 from:

The function runs the provided raw query (in the back-end dependent language) and returns the results (if any) in the provided AVP. The result_avp can be missing, if the query returns no results.

to:

The function runs the provided raw query (in the back-end dependent language) and returns the results (if any) in the AVP (or AVP list) provided in result. This parameter may be missing, if the query returns no results.

Changed lines 241-242 from:
  • result (var, optional)
to:
  • result (string, optional, no expand)
Changed line 245 from:

cache_raw_query("mongodb", "{ \"op\" : \"count\",\"query\": { \"username\" : $rU} }", $avp(mongo_count_result));

to:

cache_raw_query("mongodb", "{ \"op\" : \"count\",\"query\": { \"username\" : $rU} }", "$avp(mongo_count_result)");

July 28, 2020, at 08:05 PM by rvlad_patrascu -
Changed lines 482-484 from:
  • attrs (var, optional) - AVP containing the the names of the attributes
  • vals (var, optional) - AVP containing values attached to the event
to:
  • attrs (var, optional) - AVP containing the the names of the attributes; if this parameter is missing and vals is provided, the attributes will be written as array(positional) params in the JSON-RPC payload
  • vals (var, optional) - AVP containing values attached to the event; if this parameter is missing, the raised event will not have any attributes, even if the attrs parameter is provided.
Added lines 499-506:

@]

Example of usage (raises an event with two unnamed attributes):

[@ $avp(attr-val) = 1; $avp(attr-val) = "2"; raise_event("E_TWO_PARAMS", , $avp(attr-val));

April 21, 2020, at 05:48 PM by liviu -
Changed line 497 from:

$avp(attr-val) = "2"

to:

$avp(attr-val) = "2";

August 08, 2019, at 05:14 PM by rvlad_patrascu -
Added lines 614-615:

Note that the rewritehost alias for this function has been removed.

Added lines 627-628:

Note that the rewritehostport alias for this function has been removed.

Added lines 640-641:

Note that the rewriteuser alias for this function has been removed.

Added lines 653-654:

Note that the rewriteuserpass alias for this function has been removed.

Added lines 666-667:

Note that the rewriteport alias for this function has been removed.

Added lines 675-679:

Parameters:

  • uri (string)

Note that the rewriteuri alias for this function has been removed.

August 08, 2019, at 04:43 PM by rvlad_patrascu -
Changed lines 640-641 from:

rewriteuserpass() / setuserpass()

to:

setuserpass(pass)

Added lines 644-646:

Parameters:

  • pass (string)
Changed lines 649-652 from:
    rewriteuserpass("my_secret_passwd");

rewriteport() / setport()

to:
    setuserpass("my_secret_passwd");

setport(port)

Added lines 655-657:

Parameters:

  • port (string)
Changed lines 660-663 from:
    rewriteport("5070");

rewriteuri(str) / seturi(str)

to:
    setport("5070");

seturi(str)

Changed lines 668-669 from:
    rewriteuri("sip:test@opensips.org");
to:
    seturi("sip:test@opensips.org");
Changed lines 682-683 from:

script_trace([log_level, pv_format_string[, info_string]])

to:

script_trace([log_level, pv_format_string, [info]])

Added lines 692-696:

Parameters:

  • log_level (int, optional)
  • pv_format_string (string, optional)
  • info (string, static, optional)
Changed lines 716-719 from:

Send the original SIP message to a specific destination in stateless mode. This is definied as [proto:]host[:port]. No changes are applied to received message, no Via header is added, unless headers parameter is specified. Host can be an IP or hostname; supported protocols are UDP, TCP and TLS. (For TLS, you need to compile the TLS support into core). If proto or port are not specified, NAPTR and SRV lookups will be used to determine them (if possible). The headers parameter should end in '\r\n' and can accept both plain text and pseudo variables.

Parameter is mandatory and has string format.

to:

Send the original SIP message to a specific destination in stateless mode. This is definied as [proto:]host[:port]. No changes are applied to received message, no Via header is added, unless headers parameter is specified. Host can be an IP or hostname; supported protocols are UDP, TCP and TLS. (For TLS, you need to compile the TLS support into core). If proto or port are not specified, NAPTR and SRV lookups will be used to determine them (if possible). The headers parameter should end in '\r\n'.

Parameters:

  • destination (string)
  • headers (string, optional)
Changed lines 741-744 from:

If "clear_previous" is set to non-zero, all previous results of another "serialize_branches()" (serial forking set which is no longer needed) will be deleted before starting a new set.

If "keep_order" is set to non-zero, the added branches as well as the current branch, will be serialized exactly in the order in which they are found.

to:

Parameters:

  • clear_previous (int) - if set to non-zero, all previous results of another "serialize_branches()" (serial forking set which is no longer needed) will be deleted before starting a new set
  • keep_order (int, optional) - if set to non-zero, the added branches as well as the current branch, will be serialized exactly in the order in which they are found.
Changed lines 758-759 from:

set_advertised_address(ip|string)

to:

set_advertised_address(adv_addr)

Added lines 762-764:

Parameters:

  • adv_addr (string)
Changed lines 769-770 from:

set_advertised_port(int)

to:

set_advertised_port(adv_port)

Added lines 773-775:

Parameters:

  • adv_port (string)
Changed lines 778-781 from:
    set_advertised_port(5080);

setdsturi(string)

to:
    set_advertised_port("5080");

setdsturi(uri)

Added lines 784-786:

Parameters:

  • uri (string)
Changed lines 791-792 from:

setflag(string)

to:

setflag(flag)

Added lines 795-797:

Parameters:

  • flag (string, static)
Changed line 801 from:
    setflag(NAT_PING);
to:
    setflag("NAT_PING");
Changed lines 805-808 from:

setbflag([branch_idx,] flag)

Set a flag for a specific branch. The value of the "flag" parameter must be an unquoted string. "branch_idx" identifies the branch for which the flag is set - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default. The OpenSIPS script supports, at most, 32 unique string branch flags.

to:

setbflag(flag, [branch_idx])

Set a flag for a specific branch. "branch_idx" identifies the branch for which the flag is set - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default. The OpenSIPS script supports, at most, 32 unique string branch flags.

Added lines 811-814:

Parameters:

  • flag (string, static)
  • branch_idx (int, optional)
Changed line 818 from:
    setbflag(1, NAT_PING);
to:
    setbflag(1, "NAT_PING");
Changed line 820 from:
    setbflag(NAT_PING); # same as setbflag(0, NAT_PING)
to:
    setbflag("NAT_PING"); # same as setbflag(0, "NAT_PING")
Changed lines 823-824 from:

strip(int)

to:

strip(n)

Added lines 827-829:

Parameters:

  • n (int)
Changed lines 834-835 from:

strip_tail(int)

to:

strip_tail(n)

Added lines 838-840:

Parameters:

  • n (int)
Changed lines 850-851 from:

The first parameter is a string represents the name of the event an external application should be notified for. The second parameter is a string that specifies the socket of the external application. Note that this socket should follow the syntax of an existing loaded Event Interface transport module (example: event_datagram, event_rabbitmq). The last parameter is optional and specifies the expire time of the subscription. If it is not present, then the subscription does not expire at all.

to:

Parameters:

  • event (string) - the name of the event an external application should be notified for.
  • socket (string) - the socket of the external application. Note that this socket should follow the syntax of an existing loaded Event Interface transport module (example: event_datagram, event_rabbitmq).
  • expire (int, optional) - the expire time of the subscription. If it is not present, then the subscription does not expire at all.
Changed lines 871-872 from:

use_blacklist(string)

to:

use_blacklist(bl_name)

Added lines 874-877:

Parameters:

  • bl_name (string)
Added lines 880-890:

@]

unuse_blacklist(bl_name)

Disables the DNS blacklist name received as parameter.

Parameters:

  • bl_name (string)

[@

    unuse_blacklist("pstn-gws");
August 08, 2019, at 03:17 PM by rvlad_patrascu -
Changed lines 44-46 from:
  • uri (string, optional)
  • qvalue(string, optional)
to:
  • uri (string, optional)
  • qvalue (string, optional)
Changed lines 104-108 from:
  • storage_id (string)
  • attribute (string)
  • value (string)
  • timeout (int, optional)
to:
  • storage_id (string)
  • attribute (string)
  • value (string)
  • timeout (int, optional)
Changed lines 127-129 from:
  • storage_id (string)
  • attribute (string)
to:
  • storage_id (string)
  • attribute (string)
Changed lines 150-153 from:
  • storage_id (string)
  • attribute (string)
  • result (var)
to:
  • storage_id (string)
  • attribute (string)
  • result (var)
Changed lines 173-177 from:
  • storage_id (string)
  • attribute (string)
  • result (var)
to:
  • storage_id (string)
  • attribute (string)
  • result (var)
Changed lines 195-200 from:
  • storage_id (string)
  • attribute (string)
  • increment (int)
  • expire (int) - if greater than 0, the key will also expire in the specified number of seconds
  • new_val (var, optional) - variable in which to fetch the new value of the counter.
to:
  • storage_id (string)
  • attribute (string)
  • increment (int)
  • expire (int) - if greater than 0, the key will also expire in the specified number of seconds
  • new_val (var, optional) - variable in which to fetch the new value of the counter.
Changed lines 217-222 from:
  • storage_id (string)
  • attribute (string)
  • increment (int)
  • expire (int) - if greater than 0, the key will also expire in the specified number of seconds
  • new_val (var, optional) - variable in which to fetch the new value of the counter.
to:
  • storage_id (string)
  • attribute (string)
  • increment (int)
  • expire (int) - if greater than 0, the key will also expire in the specified number of seconds
  • new_val (var, optional) - variable in which to fetch the new value of the counter.
Changed lines 239-242 from:
  • storage_id (string)
  • raw_query (string)
  • result (var, optional)
to:
  • storage_id (string)
  • raw_query (string)
  • result (var, optional)
Changed lines 262-268 from:
  • proto (string)
  • user (string, optional)
  • domain (string)
  • port (string, optional)
  • extra (string, optional)
  • result(var)
to:
  • proto (string)
  • user (string, optional)
  • domain (string)
  • port (string, optional)
  • extra (string, optional)
  • result (var)
Changed lines 328-329 from:
  • socket (string)
to:
  • socket (string)
Changed lines 340-341 from:
  • port_alias (int, optional)
to:
  • port_alias (int, optional)
Changed lines 352-353 from:
  • destination (string, optional) - if missing, the forward will be done based on RURI.
to:
  • destination (string, optional) - if missing, the forward will be done based on RURI.
Changed lines 365-367 from:
  • sec_avp (var)
  • usec_avp (var)
to:
  • sec_avp (var)
  • usec_avp (var)
Changed lines 390-391 from:
  • flag (string, static)
to:
  • flag (string, static)
Changed lines 399-402 from:

isbflagset([branch_idx,] flag)

Test if a flag is set for a specific branch. The value of the "flag" parameter must be an unquoted string. "branch_idx" identifies the branch for which the flags are tested - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

isbflagset(flag, [branch_idx])

Test if a flag is set for a specific branch. "branch_idx" identifies the branch for which the flags are tested - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

Added lines 405-408:

Parameters:

  • flag (string, static)
  • branch_idx (int, optional)
Changed line 412 from:
    if (isbflagset(1, NAT_PING))
to:
    if (isbflagset(1, "NAT_PING"))
Changed lines 449-450 from:

prefix(string)

to:

prefix(str)

Changed lines 454-455 from:
  • prefix (string)
to:
  • str (string)
Changed lines 465-467 from:
  • pv (var)
  • string (string)
to:
  • pv (var)
  • string (string)
Changed lines 481-484 from:
  • event (string) - the name of the event which should be raised
  • attrs (var, optional) - AVP containing the the names of the attributes
  • vals (var, optional) - AVP containing values attached to the event
to:
  • event (string) - the name of the event which should be raised
  • attrs (var, optional) - AVP containing the the names of the attributes
  • vals (var, optional) - AVP containing values attached to the event
Changed lines 501-502 from:

remove_branch(pv|int)

to:

remove_branch(branch_idx)

Changed lines 507-508 from:
  • branch_idx (int)
to:
  • branch_idx (int)
Changed lines 574-575 from:
  • flags (string, static)
to:
  • flags (string, static)
Changed lines 582-585 from:

resetbflag([branch_idx,] flag)

Reset a flag for a specific branch (unset its value). The value of the "flag" parameter is an unquoted string. "branch_idx" identifies the branch for which the flag is reset - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

resetbflag(flag, [branch_idx])

Reset a flag for a specific branch (unset its value). "branch_idx" identifies the branch for which the flag is reset - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

Parameters:

  • flag (string, static)
  • branch_idx (int, optional)
Changed line 594 from:
    resetbflag(1, NAT_PING);
to:
    resetbflag(1, "NAT_PING");
Changed line 596 from:
    resetbflag(NAT_PING); # same as resetbflag(0, NAT_PING)
to:
    resetbflag("NAT_PING"); # same as resetbflag(0, "NAT_PING")
Changed lines 607-608 from:

sethost()

to:

sethost(host)

Added lines 611-613:

Parameters:

  • host (string)
Changed lines 618-619 from:

rewritehostport() / sethostport()

to:

sethostport(hostport)

Added lines 622-624:

Parameters:

  • hostport (string)
Changed lines 627-630 from:
    rewritehostport("1.3.4.4:5080");

rewriteuser(string) / setuser(string)

to:
    sethostport("1.3.4.4:5080");

setuser(user)

Added lines 633-635:

Parameters:

  • user (string)
Changed line 638 from:
    rewriteuser("newuser");
to:
    setuser("newuser");
August 07, 2019, at 07:52 PM by rvlad_patrascu -
Added lines 327-329:

Parameters:

  • socket (string)
Changed lines 332-333 from:
    force_send_socket(tcp:10.10.10.10:5060);
to:
    force_send_socket("tcp:10.10.10.10:5060");
Added lines 339-341:

Parameters:

  • port_alias (int, optional)
Changed lines 351-352 from:

If destination parameter is missing, the forward will be done based on RURI.

to:

Parameters:

  • destination (string, optional) - if missing, the forward will be done based on RURI.
Added lines 364-367:

Parameters:

  • sec_avp (var)
  • usec_avp (var)
Added lines 389-391:

Parameters:

  • flag (string, static)
Changed line 395 from:
    if (isflagset(NAT_PING))
to:
    if (isflagset("NAT_PING"))
Changed lines 414-415 from:

Test if the host and optionally the port represent one of the addresses that OpenSIPS listens on. This checks the list of local IP addresses, hostnames and aliases that have been set in the OpenSIPS configuration file. Both the host and port may contain pseudo-variables.

to:

Test if the host and optionally the port represent one of the addresses that OpenSIPS listens on. This checks the list of local IP addresses, hostnames and aliases that have been set in the OpenSIPS configuration file.

Parameters:

  • host (string)
  • port (int, optional)
Changed line 422 from:
    if (is_myself("$rd", "$rp")
to:
    if (is_myself("$rd", $rp)
Added lines 449-451:

Parameters:

  • prefix (string)
Changed lines 456-461 from:

pv_printf(pv, string)

Prints the formatted 'string' in the AVP 'pv'. The 'string' parameter can include any pseudo-variable defined in OpenSIPS. The 'pv' can be any writable pseudo-variable -- e.g.,: AVPs, VARs, $ru, $rU, $rd, $du, $br, $fs.

It was extended from the avp_printf(...) function exported in previous versions by the avpops module. Starting with 1.3.4, avp_printf(...) is just an alias to pv_printf(...).

to:

pv_printf(pv, fmt_str)

Prints the formatted string 'fmt_str' in the AVP 'pv'. The 'fmt_str' parameter can include any pseudo-variable defined in OpenSIPS. The 'pv' can be any writable pseudo-variable -- e.g.,: AVPs, VARs, $ru, $rU, $rd, $du, $br, $fs.

Parameters:

  • pv (var)
  • string (string)
Changed lines 466-468 from:
    pv_printf("$var(x)", "r-uri: $ru");
    pv_printf("$avp(i:3)", "from uri: $fu");
to:
    pv_printf($var(x), "r-uri: $ru");
    pv_printf($avp(i:3), "from uri: $fu");
Changed lines 470-473 from:

raise_event(string[, avp[, avp ] ] )

Raises from script an event through OpenSIPS Event Interface. The first parameter is a string that indicates the event which should be raised. The next two parameters should be AVPs and they are optional. If only one is present, it should contain the values attached to the event. If both of them are specified, the first one should contain the names of the attributes, and the last one the values attached to the event.

to:

raise_event(event, [attrs], [vals])

Raises from script an event through OpenSIPS Event Interface.

Added lines 476-480:

Parameters:

  • event (string) - the name of the event which should be raised
  • attrs (var, optional) - AVP containing the the names of the attributes
  • vals (var, optional) - AVP containing values attached to the event
Changed lines 499-501 from:

Removes a given branch. The branch to be removed can be given via an integer or a pseudovariable. Once a branch is remove, all the subsequent branches are shifted (i.e. if branch n is removed, then the old n+1 branch becomes the new n branch, the old n+2 branch becomes n+1 and so on).

to:

Removes a given branch. Once a branch is removed, all the subsequent branches are shifted (i.e. if branch n is removed, then the old n+1 branch becomes the new n branch, the old n+2 branch becomes n+1 and so on).

Parameters:

  • branch_idx (int)
Changed lines 563-564 from:

resetflag(string)

to:

resetflag(flag)

Added lines 569-571:

Parameters:

  • flags (string, static)
Changed line 575 from:
    resetflag(NAT_PING);
to:
    resetflag("NAT_PING");
Changed lines 599-600 from:

rewritehost() / sethost()

to:

sethost()

Changed line 605 from:
    rewritehost("1.3.4.4");
to:
    sethost("1.3.4.4");
August 07, 2019, at 07:04 PM by rvlad_patrascu -
Changed lines 257-259 from:

construct_uri(proto,user,domain,port,extra,result_avp)

The function builds a valid sip uri based on the arguments it receives. The result (if any) will be stored in the result_avp AVP variable. The function accepts plain text arguments, as well as $var and $avp variables. If you want to omit a part of the sip uri, just set the respective parameter to a blank string.

to:

construct_uri(proto,[user],domain,[port],[extra],result)

The function builds a valid sip uri based on the arguments it receives. The result (if any) will be stored in the result AVP variable. If you want to omit a part of the sip uri, just omit the respective parameter.

Parameters:

  • proto (string)
  • user (string, optional)
  • domain (string)
  • port (string, optional)
  • extra (string, optional)
  • result(var)
August 07, 2019, at 03:08 PM by rvlad_patrascu -
Changed lines 143-146 from:

cache_fetch(storage_id, attribute_str, result_pvar)

This function fetches from a memory-cache-like storage system the value of an attribute. The attribute name may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

to:

cache_fetch(storage_id, attribute, result)

This function fetches from a memory-cache-like storage system the value of an attribute. The result (if any) will be stored in the variable specified by result.

Added lines 149-153:

Parameters:

  • storage_id (string)
  • attribute (string)
  • result (var)
Changed lines 166-169 from:

cache_counter_fetch(storage_id, counter_attribute_str, result_avp)

This function fetches from a memory-cache-like storage system the value of a counter. The attribute string may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

to:

cache_counter_fetch(storage_id, counter_attribute, result)

This function fetches from a memory-cache-like storage system the value of a counter. The result (if any) will be stored in the variable specified by result.

Added lines 172-177:

Parameters:

  • storage_id (string)
  • attribute (string)
  • result (var)
Changed lines 188-191 from:

cache_add( storage_id, attribute_str, increment_value, expire[, new_val_pvar])

This increments an attribute in a memory-cache-like storage system that supports such an operation. The attribute name may contain pseudo-variables. If the attribute does not exit, it will be created with the increment_value. If expire > 0, the key will also expire in the specified number of seconds.

to:

cache_add( storage_id, attribute, increment, expire, [new_val])

This increments an attribute in a memory-cache-like storage system that supports such an operation. If the attribute does not exit, it will be created with the value of increment.

Changed lines 194-195 from:

Optionally, the function receives one last parameter as a pvar in which to fetch the new value of the counter.

to:

Parameters:

  • storage_id (string)
  • attribute (string)
  • increment (int)
  • expire (int) - if greater than 0, the key will also expire in the specified number of seconds
  • new_val (var, optional) - variable in which to fetch the new value of the counter.
Changed line 205 from:

cache_add("redis:cluster1", 5);

to:

cache_add("redis:cluster1", "my_counter", 5, 0);

Changed lines 210-213 from:

cache_sub(storage_id, attribute_str, increment_value, expire[, new_val_pvar])

This decrements an attribute in a memory-cache-like storage system that supports such an operation. The attribute name may contain pseudo-variables. If expire > 0, the key will also expire in the specified number of seconds.

to:

cache_sub(storage_id, attribute, decrement, expire, [new_val])

This decrements an attribute in a memory-cache-like storage system that supports such an operation.

Changed lines 216-217 from:

Optionally, the function receives one last parameter as a pvar in which to fetch the new value of the counter.

to:

Parameters:

  • storage_id (string)
  • attribute (string)
  • increment (int)
  • expire (int) - if greater than 0, the key will also expire in the specified number of seconds
  • new_val (var, optional) - variable in which to fetch the new value of the counter.
Changed line 227 from:

cache_sub("redis:cluster1", 5);

to:

cache_sub("redis:cluster1", "my_counter", 5, 0);

Changed lines 232-233 from:

cache_raw_query(storage_id, raw_query, result_avp)

to:

cache_raw_query(storage_id, raw_query, result)

Added lines 238-242:

Parameters:

  • storage_id (string)
  • raw_query (string)
  • result (var, optional)
Changed line 245 from:

cache_raw_query("mongodb", "{ \"op\" : \"count\",\"query\": { \"username\" : $rU} }", "$avp(mongo_count_result)");

to:

cache_raw_query("mongodb", "{ \"op\" : \"count\",\"query\": { \"username\" : $rU} }", $avp(mongo_count_result));

August 07, 2019, at 02:31 PM by rvlad_patrascu -
Changed lines 122-125 from:

cache_remove(storage_id, attribute_str)

This removes an attribute from a memory-cache-like storage system. The attribute name may contain pseudo-variables. Function returns false only if the storage_id is invalid.

to:

cache_remove(storage_id, attribute)

This removes an attribute from a memory-cache-like storage system. Function returns false only if the storage_id is invalid.

Parameters:

  • storage_id (string)
  • attribute (string)
August 07, 2019, at 02:29 PM by rvlad_patrascu -
Changed lines 97-100 from:

cache_store(storage_id, attribute_str, value_str[, timeout])

This sets in a memory-cache-like storage system a new value for an attribute. Both the attribute name and value may contain pseudo-variables. If the attribute does not already exist in the memcache, it will be inserted with the given value; if already present, its value will be replaced with the new one. The function may optionally take an extra parameter, a timeout (or lifetime) value for the attribute - after the lifetime is exceeded, the attribute is automatically purged from memcache. If "timeout" is omitted or has a value or 0, the attribute/value pair will never expire.

to:

cache_store(storage_id, attribute, value, [timeout])

This sets in a memory-cache-like storage system a new value for an attribute. If the attribute does not already exist in the memcache, it will be inserted with the given value; if already present, its value will be replaced with the new one. The function may optionally take an extra parameter, a timeout (or lifetime) value for the attribute - after the lifetime is exceeded, the attribute is automatically purged from memcache. If "timeout" is omitted or has a value or 0, the attribute/value pair will never expire.

Added lines 102-107:

Parameters:

  • storage_id (string)
  • attribute (string)
  • value (string)
  • timeout (int, optional)
August 07, 2019, at 02:13 PM by rvlad_patrascu -
Changed lines 33-34 from:

append_branch()

to:

append_branch([uri], [qvalue])

Added lines 42-45:

Parameters:

  • uri (string, optional)
  • qvalue(string, optional)
May 09, 2019, at 01:47 PM by liviu -
Changed line 95 from:

This sets in a memory-cache-like storage system a new value for an attribute. Both the attribute name and value may contain pseudo-variables. If the attribute does not already exist in the memcache, it will be inserted with the given value; if already present, its value will be replaced with the new one. The function may optionally take an extra parameter, a timeout (or lifetime) value for the attribute - after the lifetime is exceeded, the attribute is automatically purged from memcache.

to:

This sets in a memory-cache-like storage system a new value for an attribute. Both the attribute name and value may contain pseudo-variables. If the attribute does not already exist in the memcache, it will be inserted with the given value; if already present, its value will be replaced with the new one. The function may optionally take an extra parameter, a timeout (or lifetime) value for the attribute - after the lifetime is exceeded, the attribute is automatically purged from memcache. If "timeout" is omitted or has a value or 0, the attribute/value pair will never expire.

April 19, 2019, at 05:10 PM by liviu -
Changed lines 95-96 from:

This sets in a memory-cache-like-storage system a new value for an attribute. Both the attribute name and value may contain pseudo-variables. If the attribute does not already exist in the memcache, it will be inserted with the given value; if already present, its value will be replaced with the new one. The function may optionally take an extra parameter, a timeout (or lifetime) value for the attribute - after the lifetime is exceeded, the attribute is automatically purged from memcache.

to:

This sets in a memory-cache-like storage system a new value for an attribute. Both the attribute name and value may contain pseudo-variables. If the attribute does not already exist in the memcache, it will be inserted with the given value; if already present, its value will be replaced with the new one. The function may optionally take an extra parameter, a timeout (or lifetime) value for the attribute - after the lifetime is exceeded, the attribute is automatically purged from memcache.

Changed line 114 from:

This removes an attribute from a memory-cache-like-storage system. The attribute name may contain pseudo-variables.

to:

This removes an attribute from a memory-cache-like storage system. The attribute name may contain pseudo-variables.

Changed lines 132-133 from:

This function fetches from a memory-cache-like-storage system the value of an attribute. The attribute name may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

to:

This function fetches from a memory-cache-like storage system the value of an attribute. The attribute name may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

Changed lines 150-151 from:

This function fetches from a memory-cache-like-storage system the value of a counter. The attribute string may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

to:

This function fetches from a memory-cache-like storage system the value of a counter. The attribute string may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

Changed lines 166-167 from:

This increments an attribute in a memory-cache-like-storage system that supports such an operation. The attribute name may contain pseudo-variables. If the attribute does not exit, it will be created with the increment_value. If expire > 0, the key will also expire in the specified number of seconds.

to:

This increments an attribute in a memory-cache-like storage system that supports such an operation. The attribute name may contain pseudo-variables. If the attribute does not exit, it will be created with the increment_value. If expire > 0, the key will also expire in the specified number of seconds.

Changed line 183 from:

This decrements an attribute in a memory-cache-like-storage system that supports such an operation. The attribute name may contain pseudo-variables. If expire > 0, the key will also expire in the specified number of seconds.

to:

This decrements an attribute in a memory-cache-like storage system that supports such an operation. The attribute name may contain pseudo-variables. If expire > 0, the key will also expire in the specified number of seconds.

August 22, 2018, at 06:34 PM by liviu -
Changed lines 137-138 from:

cache_fetch("local", "credit_$fU", $avp(ret));

to:

cache_fetch("local", "credit_$fU", $var(ret));

Changed line 143 from:

cache_fetch("redis:cluster1", "credit_$fU", $avp(ret));

to:

cache_fetch("redis:cluster1", "credit_$fU", $var(ret));

Changed lines 155-156 from:

cache_counter_fetch("local", "my_counter", $avp(counter_val));

to:

cache_counter_fetch("local", "my_counter", $var(counter_val));

Changed line 161 from:

cache_fetch("redis:cluster1", "my_counter", $avp(redis_counter_val));

to:

cache_fetch("redis:cluster1", "my_counter", $var(redis_counter_val));

April 23, 2018, at 03:45 PM by razvancrainea -
Deleted lines 661-665:

setdebug([level]) (Removed in OpenSIPS 3.4)

Replaced as functionality by the $log_level script variable.

March 30, 2018, at 11:54 AM by liviu -
Changed line 620 from:

Takes all currently added branches for parallel forking (with append_branch()), as well as the current branch: (R-URI, $ru / outbound Proxy, $du / q value, $ru_q / branch flags / forced Path headers / forced send socket), and prepares them for serial forking instead. The ordering is done in decreasing "q" order. The serialized branches are internally stored in the "$avp(serial_branch)" AVP - this allows them to be manipulated by the "next_branches()" function, usually within a failure route.

to:

Takes all currently added branches for parallel forking (with append_branch()), as well as the current branch: (R-URI ($ru) / outbound Proxy ($du) / q value ($ru_q) / branch flags / forced Path headers / forced send socket), and prepares them for serial forking instead. The ordering is done in decreasing "q" order. The serialized branches are internally stored in the "$avp(serial_branch)" AVP - this allows them to be manipulated by the "next_branches()" function, usually within a failure route.

March 30, 2018, at 11:53 AM by liviu -
Changed lines 624-625 from:

NOTE that (according to RFC3261), the branches with the same "q" value will still be parallel forked during a certain step in the serial forking (it will result a combination of serial with parallel forking). In other words, this function will clear all added branches, and keep re-adding them as long as they have identical highest "q" values. A similar grouping process takes place during a "next_branches()" function call.

to:

NOTE that (according to RFC3261), the branches with the same "q" value will still be parallel forked during a certain step in the serial forking (it will result a combination of serial with parallel forking). In other words, this function will clear all added branches and keep re-adding them as long as they have identical highest "q" values, while throwing all other "lower-than-highest q" branches in the "$avp(serial_branch)". A similar grouping process takes place during each "next_branches()" function call.

Changed lines 630-632 from:

If "clear_previous" is set to non-zero, all previous results of another "serialize_branches()" (serial forking set which is no longer needed) will be deleted before starting a new set.

If "keep_order" is set to non-zero, the added branches as well as the current branch, will be serialized exactly in the order in which they are found.

to:

If "clear_previous" is set to non-zero, all previous results of another "serialize_branches()" (serial forking set which is no longer needed) will be deleted before starting a new set.

If "keep_order" is set to non-zero, the added branches as well as the current branch, will be serialized exactly in the order in which they are found.

March 30, 2018, at 11:49 AM by liviu -
Changed lines 620-621 from:

Clears all currently added branches for parallel forking (with append_branch()), including the current branch: (R-URI, $ru / outbound Proxy, $du / q value, $ru_q / branch flags / forced Path headers / forced send socket), and prepares them for serial forking instead. The ordering is done in decreasing "q" order. The serialized branches are internally stored in the "$avp(serial_branch)" AVP - this allows them to be manipulated by the "next_branches()" function, usually within a failure route.
NOTE that (according to RFC3261), the branches with the same "q" value will still be parallel forked during a certain step in the serial forking (it will result a combination of serial with parallel forking).\\

to:

Takes all currently added branches for parallel forking (with append_branch()), as well as the current branch: (R-URI, $ru / outbound Proxy, $du / q value, $ru_q / branch flags / forced Path headers / forced send socket), and prepares them for serial forking instead. The ordering is done in decreasing "q" order. The serialized branches are internally stored in the "$avp(serial_branch)" AVP - this allows them to be manipulated by the "next_branches()" function, usually within a failure route.


NOTE that (according to RFC3261), the branches with the same "q" value will still be parallel forked during a certain step in the serial forking (it will result a combination of serial with parallel forking). In other words, this function will clear all added branches, and keep re-adding them as long as they have identical highest "q" values. A similar grouping process takes place during a "next_branches()" function call.


March 30, 2018, at 11:45 AM by liviu -
Changed lines 371-373 from:

Adds to the request a new destination set that includes all highest priority class contacts ('q' value based) from the serialized branches (see serialize_branches()). If called from a route block, it rewrites the request uri with first contact and adds the remaining contacts as parallel branches. If called from failure route block, adds all contacts as parallel branches. All used contacts are removes the serialized branches.

to:

Adds to the request a new destination set that includes all highest priority class contacts ('q' value based) from the serialized branches (see serialize_branches()). If called from a route block, it rewrites the request uri with first contact and adds the remaining contacts as parallel branches. If called from failure route block, adds all contacts as parallel branches. All used contacts are removes the serialized branches.

Changed lines 618-620 from:

serialize_branches(clear)

Takes all the branches added for parallel forking (with append_branch() and including the current RURI) and prepare them for serial forking. The ordering is done in increasing "q" order. The serialized branches are internally stored in AVPs - you will be able to fetch and use via the "next_branches()" function.\\

to:

serialize_branches(clear_previous[, keep_order])

Clears all currently added branches for parallel forking (with append_branch()), including the current branch: (R-URI, $ru / outbound Proxy, $du / q value, $ru_q / branch flags / forced Path headers / forced send socket), and prepares them for serial forking instead. The ordering is done in decreasing "q" order. The serialized branches are internally stored in the "$avp(serial_branch)" AVP - this allows them to be manipulated by the "next_branches()" function, usually within a failure route.\\

Changed lines 622-625 from:

NOTE that this function is not changing RURI in the messages - it is just converting from parallel to serial branches (preparing branches).

If "clear" is set to non-zero, all previous results of another "serialize_branches" (serialized branches which were not yet used) will be deleted before setting the new serialized branches.

to:

NOTE that this function is not altering the current branch (R-URI, outbound proxy, etc.) - it is just preparing a serial forking set with the above-mentioned branches. You may need to call "next_branches()" immediately after calling this function, see the example below.

If "clear_previous" is set to non-zero, all previous results of another "serialize_branches()" (serial forking set which is no longer needed) will be deleted before starting a new set.

If "keep_order" is set to non-zero, the added branches as well as the current branch, will be serialized exactly in the order in which they are found.

Changed lines 630-631 from:
   serialize_branches(1);
to:
    if (!lookup("location")) {
        t_reply("480", "Temporarily Unavailable");
        exit;
    }

    serialize_branches(1);
    next_branches(); # Pop the R-URI from the serialized branches set
March 21, 2018, at 02:35 PM by liviu -
Changed lines 740-743 from:
  • L_WARN (0)
  • L_NOTICE (1)
  • L_INFO (2)
  • L_DBG (3)
to:
  • L_WARN (1)
  • L_NOTICE (2)
  • L_INFO (3)
  • L_DBG (4)
November 21, 2017, at 11:29 AM by liviu -
Changed line 675 from:

Set a flag for a specific branch. The value of the "flag" parameter must be an unquoted string. "branch_idx" identifies the branch for which the flag is set - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

Set a flag for a specific branch. The value of the "flag" parameter must be an unquoted string. "branch_idx" identifies the branch for which the flag is set - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default. The OpenSIPS script supports, at most, 32 unique string branch flags.

November 21, 2017, at 11:18 AM by liviu -
Changed line 595 from:
    [line 581][me][core setsflag] -> (INVITE from 127.0.0.1 , ruri=sip:111211@opensips.org)
to:
    [line 581][me][core setbflag] -> (INVITE from 127.0.0.1 , ruri=sip:111211@opensips.org)
Deleted lines 685-697:

setsflag(flag_idx) (Removed in OpenSIPS 3.4)

Set a script flag (set flag to value 0). The value of the "flag_idx" parameter can be in range of 0..31.

For more about script flags, see Flags Documentation.

Example of usage:

    setsflag(2);
November 21, 2017, at 11:17 AM by liviu -
Changed lines 334-336 from:
    if (isflagset(NAT_PING)) {
        log("flag 3 is set\n");
    }
to:
    if (isflagset(NAT_PING))
        log("flag NAT_PING is set\n");
Changed lines 347-349 from:
    if (isbflagset(1, NAT_PING)) {
        log("flag 3 is set in branch 1\n");
    }
to:
    if (isbflagset(1, NAT_PING))
        log("flag NAT_PING is set in branch 1\n");
Changed lines 351-356 from:

issflagset(flag_idx) (Removed in OpenSIPS 3.4)

Test if a script flag is set (if the flag value is 1). The value of the "flag_idx" parameter can be in range of 0..31.

For more about script flags, see Flags Documentation.

to:

is_myself(host, [port])

Test if the host and optionally the port represent one of the addresses that OpenSIPS listens on. This checks the list of local IP addresses, hostnames and aliases that have been set in the OpenSIPS configuration file. Both the host and port may contain pseudo-variables.

Deleted lines 356-365:
    if(issflagset(2)) {
        log("script flag 2 is set\n");
    };

is_myself(host, [port])

Test if the host and optionally the port represent one of the addresses that OpenSIPS listens on. This checks the list of local IP addresses, hostnames and aliases that have been set in the OpenSIPS configuration file. Both the host and port may contain pseudo-variables.

Example of usage:

Deleted lines 509-520:

resetsflag(flag_idx) (Removed in OpenSIPS 3.4)

Reset a script flag (set flag to value 0). The value of the "flag_idx" parameter can be in range of 0..31.

For more about script flags, see Flags Documentation.

Example of usage:

    resetsflag(2);
November 21, 2017, at 11:15 AM by liviu -
Changed lines 339-342 from:

isbflagset([branch_idx,] flag_idx)

Test if a flag is set for a specific branch (if the flag value is 1). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flags are tested - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

isbflagset([branch_idx,] flag)

Test if a flag is set for a specific branch. The value of the "flag" parameter must be an unquoted string. "branch_idx" identifies the branch for which the flags are tested - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

Changed lines 347-348 from:
    if(isbflagset(1,3)) {
to:

[@

    if (isbflagset(1, NAT_PING)) {
Changed lines 350-351 from:
    };
to:
    }

@]

Changed lines 512-515 from:

resetbflag([branch_idx,] flag_idx)

Reset a flag for a specific branch (set flag to value 0). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flag is reset - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

resetbflag([branch_idx,] flag)

Reset a flag for a specific branch (unset its value). The value of the "flag" parameter is an unquoted string. "branch_idx" identifies the branch for which the flag is reset - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

Changed line 520 from:
    resetbflag(1,3);
to:
    resetbflag(1, NAT_PING);
Changed line 522 from:
    resetbflag(3); # same with resetbflag(0,3)
to:
    resetbflag(NAT_PING); # same as resetbflag(0, NAT_PING)
Changed lines 699-702 from:

setbflag([branch_idx,] flag_idx)

Set a flag for a specific branch (set flag to value 1). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flag is set - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

setbflag([branch_idx,] flag)

Set a flag for a specific branch. The value of the "flag" parameter must be an unquoted string. "branch_idx" identifies the branch for which the flag is set - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

Changed lines 707-708 from:
    setbflag(1,3);
to:

[@

    setbflag(1, NAT_PING);
Changed lines 710-711 from:
    setbflag(3); # same with setbflag(0,3)
to:
    setbflag(NAT_PING); # same as setbflag(0, NAT_PING)

@]

November 21, 2017, at 11:05 AM by liviu -
Changed lines 327-328 from:

Test if a flag is set for current processed message.

to:

Test if a flag is set for currently processed message.

Changed lines 500-501 from:

Reset a flag for current processed message (unset its value).

to:

Reset a flag for currently processed message (unset its value).

Added line 506:

[@

Changed lines 508-509 from:
to:

@]

Added line 692:

[@

Added line 694:

@]

November 21, 2017, at 11:03 AM by liviu -
Changed lines 325-328 from:

isflagset(int)

Test if a flag is set for current processed message (if the flag value is 1). The value of the parameter can be in range of 0..31.

to:

isflagset(string)

Test if a flag is set for current processed message.

Changed lines 333-334 from:
    if(isflagset(3)) {
to:

[@

    if (isflagset(NAT_PING)) {
Changed lines 336-337 from:
    };
to:
    }

@]

Changed lines 498-501 from:

resetflag(int)

Reset a flag for current processed message (set the value to 0). The value of the parameter can be in range of 0..31.

to:

resetflag(string)

Reset a flag for current processed message (unset its value).

Changed lines 506-507 from:
    resetflag(3);
to:
    resetflag(NAT_PING);
Changed lines 684-687 from:

setflag(int)

Set a flag for current processed message. The value of the parameter can be in range of 0..31. The flags are used to mark the message for special processing (e.g., accounting) or to keep some state (e.g., message authenticated).

to:

setflag(string)

Set a flag for currently processed message. The flags are used to mark the message for special processing (e.g. pinging NAT'ed contacts, TCP connect behavior, etc.) or to keep some state (e.g. message authenticated). The OpenSIPS script supports, at most, 32 unique string flags.

Changed line 690 from:
    setflag(3);
to:
    setflag(NAT_PING);
October 31, 2017, at 04:53 PM by liviu -
Changed line 287 from:

Enables TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + **source port** + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + **Via port** + transport) pair will be forced over this connection, for as long as it stays open. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

to:

Enables TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + source port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + transport) pair will be forced over this connection, for as long as it stays open. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

October 31, 2017, at 04:53 PM by liviu -
Changed line 287 from:

Enables TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + transport) pair will be forced over this connection, for as long as it stays open. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

to:

Enables TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + **source port** + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + **Via port** + transport) pair will be forced over this connection, for as long as it stays open. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

July 17, 2017, at 05:56 PM by rvlad_patrascu -
Changed line 47 from:
    if (method=="INVITE" && uri=~"sip:B@xx.xxx.xx ")
to:
    if ($rm=="INVITE" && $ru=~"sip:B@xx.xxx.xx ")
Changed line 239 from:
        if(status=="183") {
to:
        if($rs=="183") {
July 14, 2017, at 12:48 PM by rvlad_patrascu -
Changed line 13 from:

(:toc-float Table of Content:)

to:

(:toc-float Table of Contents:)

Added lines 360-368:

is_myself(host, [port])

Test if the host and optionally the port represent one of the addresses that OpenSIPS listens on. This checks the list of local IP addresses, hostnames and aliases that have been set in the OpenSIPS configuration file. Both the host and port may contain pseudo-variables.

Example of usage:

    if (is_myself("$rd", "$rp")
        xlog("the request is for local processing\n");
November 04, 2016, at 08:31 PM by liviu -
Changed lines 100-101 from:

cache_store("local", "total_credit", "$avp(credit)", 1200);

to:

cache_store("local", "total_minutes_$fU", "$avp(mins)", 1200);

Changed line 104 from:

modparam("cachedb_redis","cachedb_url","redis:cluster1://193.468.3.434:6379/")

to:

modparam("cachedb_redis", "cachedb_url", "redis:cluster1://193.468.3.434:6379/")

Changed lines 112-113 from:

cache_remove( storage_id, attribute_name)

to:

cache_remove(storage_id, attribute_str)

Changed lines 118-119 from:

cache_remove("local","my_attr");

to:

cache_remove("local", "total_minutes_$fU");

Changed line 122 from:

modparam("cachedb_redis","cachedb_url","redis:cluster1://193.468.3.434:6379/")

to:

modparam("cachedb_redis", "cachedb_url", "redis:cluster1://193.468.3.434:6379/")

Changed line 124 from:

cache_remove("redis:cluster1","my_attr");

to:

cache_remove("redis:cluster1", "total_minutes_$fU");

Changed lines 130-131 from:

cache_fetch( storage_id, attribute_name, result_pvar)

to:

cache_fetch(storage_id, attribute_str, result_pvar)

Changed lines 137-138 from:

cache_fetch("local","my_attr", $avp(i:11) );

to:

cache_fetch("local", "credit_$fU", $avp(ret));

Changed line 141 from:

modparam("cachedb_redis","cachedb_url","redis:cluster1://193.468.3.434:6379/")

to:

modparam("cachedb_redis", "cachedb_url", "redis:cluster1://193.468.3.434:6379/")

Changed line 143 from:

cache_fetch("redis:cluster1","my_attr",$avp(i:11));

to:

cache_fetch("redis:cluster1", "credit_$fU", $avp(ret));

Changed lines 148-151 from:

cache_counter_fetch( storage_id, counter_attribute_name, result_avp)

This function fetches from a memory-cache-like-storage system the value of a counter. The attribute name may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

to:

cache_counter_fetch(storage_id, counter_attribute_str, result_avp)

This function fetches from a memory-cache-like-storage system the value of a counter. The attribute string may contain pseudo-variables. The result (if any) will be stored in the pseudo-variable specified by result_pvar.

Changed lines 155-156 from:

cache_counter_fetch("local","my_counter", $avp(counter_val) );

to:

cache_counter_fetch("local", "my_counter", $avp(counter_val));

Changed line 159 from:

modparam("cachedb_redis","cachedb_url","redis:cluster1://193.468.3.434:6379/")

to:

modparam("cachedb_redis", "cachedb_url", "redis:cluster1://193.468.3.434:6379/")

Changed line 161 from:

cache_fetch("redis:cluster1","my_counter",$avp(redis_counter_val));

to:

cache_fetch("redis:cluster1", "my_counter", $avp(redis_counter_val));

Changed lines 164-165 from:

cache_add( storage_id, attribute_name,increment_value,expire,[new_val_pvar])

to:

cache_add( storage_id, attribute_str, increment_value, expire[, new_val_pvar])

Changed line 174 from:

modparam("cachedb_redis","cachedb_url","redis:cluster1://193.468.3.434:6379/")

to:

modparam("cachedb_redis", "cachedb_url", "redis:cluster1://193.468.3.434:6379/")

Changed line 176 from:

cache_add("redis:cluster1",5);

to:

cache_add("redis:cluster1", 5);

Changed lines 181-182 from:

cache_sub( storage_id, attribute_name,increment_value,expire,[new_val_pvar])

to:

cache_sub(storage_id, attribute_str, increment_value, expire[, new_val_pvar])

Changed line 191 from:

modparam("cachedb_redis","cachedb_url","redis:cluster1://193.468.3.434:6379/")

to:

modparam("cachedb_redis", "cachedb_url", "redis:cluster1://193.468.3.434:6379/")

Changed line 193 from:

cache_sub("redis:cluster1",5);

to:

cache_sub("redis:cluster1", 5);

Changed lines 198-201 from:

cache_raw_query( storage_id, raw_query,result_avp)

The function runs the provided raw query ( in the back-end dependent language ) and returns the results ( if any ) in the provided AVP. The result_avp can be missing, if the query returns no results.

to:

cache_raw_query(storage_id, raw_query, result_avp)

The function runs the provided raw query (in the back-end dependent language) and returns the results (if any) in the provided AVP. The result_avp can be missing, if the query returns no results.

Changed line 206 from:

cache_raw_query("mongodb","{ \"op\" : \"count\",\"query\": { \"username\" : $rU} }","$avp(mongo_count_result)");

to:

cache_raw_query("mongodb", "{ \"op\" : \"count\",\"query\": { \"username\" : $rU} }", "$avp(mongo_count_result)");

November 04, 2016, at 08:24 PM by liviu -
Changed lines 93-94 from:

cache_store( storage_id, attribute_name, attribute_name [,timeout])

to:

cache_store(storage_id, attribute_str, value_str[, timeout])

Changed lines 97-98 from:

Function returns true is the new attribute was successfully inserted.

to:

Function returns true if the new attribute was successfully inserted.

Changed lines 100-101 from:

cache_store("local","my_attr","$avp(i:55)",1200);

to:

cache_store("local", "total_credit", "$avp(credit)", 1200);

Changed line 106 from:

cache_store("redis:cluster1","passwd_$tu","$var(x)");

to:

cache_store("redis:cluster1", "passwd_$tu", "$var(x)");

June 21, 2016, at 12:29 PM by liviu -
Changed line 287 from:

Employs TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + transport) pair will be forced over this connection, for as long as it stays open. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

to:

Enables TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + transport) pair will be forced over this connection, for as long as it stays open. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

June 21, 2016, at 12:25 PM by liviu -
Added lines 288-289:

\\

June 21, 2016, at 12:05 PM by liviu -
Changed line 287 from:

Employs TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + transport) pair will be forced over this connection. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

to:

Employs TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + transport) pair will be forced over this connection, for as long as it stays open. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

June 21, 2016, at 12:03 PM by liviu -
Changed line 287 from:

Employs TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + proto) pair will be forced over this connection. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

to:

Employs TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + transport) pair will be forced over this connection. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

June 21, 2016, at 12:03 PM by liviu -
Changed lines 287-293 from:

Adds a TCP port alias for the current TCP connection. Has no effect for other protocols. Useful if you want to send all traffic to port_alias through the same connection this request came from (it could help for firewall or NAT traversal). If no port is given, the port of the Via header field will be used. When the "aliased" connection is closed (e.g. idle for too much time), all port aliases are removed.

to:

Employs TCP connection reusage (RFC 5923) for the current TLS (or WSS, TCP, WS) connection (source IP + Via port + transport), regardless if the Via header field contains an ";alias" parameter or not. All backwards SIP requests, towards the same (source IP + Via port + proto) pair will be forced over this connection. The main purpose of this function (and of RFC 5923) is to minimize the number of TLS connections a SIP proxy must set up, due to the significant CPU overhead of the TLS cipher negotiation phase.

WARNING! Do not perform force_tcp_alias() for end-user initiated connections (who are most likely grouped by one or more public IPs), as this would create an open vector for call hijacking!

June 21, 2016, at 11:49 AM by liviu -
Changed line 284 from:
to:

March 24, 2016, at 09:22 PM by 109.102.83.452 -
Changed lines 663-677 from:

setdebug([level])

Changes the debug level of the current process from script. If called without the parameter then the debug level of the current process will be reset to its default level. This function is very helpful if you are tracing and debugging only a specific piece of code.

Example of usage:

    debug= -1 # errors only
    .....
    {
      ......
      setdebug(4); # set the debug level of the current process to DBG
      uac_replace_from(....);
      setdebug(); # reset the debug level of the current process to its default level
      .......
    }
to:

setdebug([level]) (Removed in OpenSIPS 3.4)

Replaced as functionality by the $log_level script variable.

March 21, 2016, at 12:05 PM by liviu -
Changed lines 289-290 from:

the same connection this request came from [it could help for firewall or nat traversal].

to:

the same connection this request came from (it could help for firewall or NAT traversal).

March 21, 2016, at 12:04 PM by liviu -
Changed lines 285-290 from:

force_tcp_alias()

force_tcp_alias(port)

adds a tcp port alias for the current connection (if tcp). Usefull if you want to send all the trafic to port_alias through

to:

force_tcp_alias([port_alias])

Adds a TCP port alias for the current TCP connection. Has no effect for other protocols. Useful if you want to send all traffic to port_alias through

Changed lines 291-293 from:

With no parameters adds the port from the message via as the alias. When the "aliased" connection is closed (e.g. it's idle for too much time), all the port aliases are removed.

to:

If no port is given, the port of the Via header field will be used. When the "aliased" connection is closed (e.g. idle for too much time), all port aliases are removed.

March 07, 2016, at 05:36 PM by liviu -
Changed lines 353-354 from:

issflagset(flag_idx)

to:

issflagset(flag_idx) (Removed in OpenSIPS 3.4)

Changed lines 516-517 from:

resetsflag(flag_idx)

to:

resetsflag(flag_idx) (Removed in OpenSIPS 3.4)

Changed line 713 from:

setsflag(flag_idx)

to:

setsflag(flag_idx) (Removed in OpenSIPS 3.4)

April 01, 2015, at 06:27 PM by liviu -
Changed lines 276-277 from:

force_send_socket([proto:]address[:port])

to:

force_send_socket(proto:address[:port])

Changed line 282 from:
    force_send_socket(10.10.10.10:5060);
to:
    force_send_socket(tcp:10.10.10.10:5060);
March 16, 2015, at 02:04 PM by liviu -
Changed line 26 from:

Only works if enable_asserts is set to true. Immediately aborts script execution and runs the error_route. If abort_on_assert is enabled, OpenSIPS will also shutdown.

to:

Only works if enable_asserts is set to true. If the given expression evaluates to false, script execution is stopped and the error_route is executed. If abort_on_assert is enabled, OpenSIPS will also shutdown.

March 16, 2015, at 01:59 PM by liviu -
Changed line 30 from:
    assert($ua == "friendly-scanner", "Forbidden UA: \"friendly-scanner\"");
to:
    assert($ua != "friendly-scanner", "Forbidden UA: \"friendly-scanner\"");
March 16, 2015, at 12:26 PM by liviu -
Changed line 26 from:

Only works if enable_asserts is set to true. Immediately aborts script execution and runs the error_route. If abort_on_assert is enabled, OpenSIPS will shutdown.

to:

Only works if enable_asserts is set to true. Immediately aborts script execution and runs the error_route. If abort_on_assert is enabled, OpenSIPS will also shutdown.

March 16, 2015, at 12:25 PM by liviu -
Changed line 26 from:

Only works if enable_asserts is set to true. Immediately aborts script execution, and runs the error_route. If abort_on_assert is enabled, OpenSIPS will shutdown.

to:

Only works if enable_asserts is set to true. Immediately aborts script execution and runs the error_route. If abort_on_assert is enabled, OpenSIPS will shutdown.

March 13, 2015, at 07:02 PM by liviu -
Changed line 26 from:

Only works if enable_asserts? is set to true. Immediately aborts script execution, and runs the error_route. If abort_on_assert? is enabled, OpenSIPS will shutdown.

to:

Only works if enable_asserts is set to true. Immediately aborts script execution, and runs the error_route. If abort_on_assert is enabled, OpenSIPS will shutdown.

March 13, 2015, at 06:52 PM by liviu -
Added lines 23-31:

assert()

Only works if enable_asserts? is set to true. Immediately aborts script execution, and runs the error_route. If abort_on_assert? is enabled, OpenSIPS will shutdown.

Example of usage:

    assert($ua == "friendly-scanner", "Forbidden UA: \"friendly-scanner\"");
February 27, 2015, at 12:57 PM by liviu -
Changed lines 334-335 from:

Test if a flag is set for a specific branch (if the flag value is 1). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flags are tested - it must be a positiv number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

Test if a flag is set for a specific branch (if the flag value is 1). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flags are tested - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

Changed lines 494-495 from:

Reset a flag for a specific branch (set flag to value 0). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flag is reset - it must be a positiv number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

Reset a flag for a specific branch (set flag to value 0). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flag is reset - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

Changed line 691 from:

Set a flag for a specific branch (set flag to value 1). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flag is set - it must be a positiv number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

to:

Set a flag for a specific branch (set flag to value 1). The value of the "flag_idx" parameter can be in range of 0..31. "branch_idx" identify the branch for which the flag is set - it must be a positive number. Branch index 0 refers to the RURI branch. If this parameter is missing, 0 branch index is used as default.

January 27, 2015, at 06:36 PM by liviu -
Changed line 585 from:

script_trace( log_level, pv_format_string[, info_string])

to:

script_trace([log_level, pv_format_string[, info_string]])

September 12, 2014, at 04:01 PM by liviu -
Changed lines 764-770 from:

L_ALERT (-3) L_CRIT (-2) L_ERR (-1) - this is used by default if log_level is omitted L_WARN (0) L_NOTICE (1) L_INFO (2) L_DBG (3)

to:
  • L_ALERT (-3)
  • L_CRIT (-2)
  • L_ERR (-1) - this is used by default if log_level is omitted
  • L_WARN (0)
  • L_NOTICE (1)
  • L_INFO (2)
  • L_DBG (3)

\\

September 12, 2014, at 04:00 PM by liviu -
Changed line 762 from:

Allows various debugging / runtime / critical messages to be printed as the execution of the OpenSIPS script is done. All pseudo-variables included in the **format_string** parameter will be expanded. There are several optional logging levels which can be specified. They work in accordance with the severity levels of syslog. The levels are named as follows:

to:

Allows various debugging / runtime / critical messages to be printed as the execution of the OpenSIPS script is done. All pseudo-variables included in the format_string parameter will be expanded. There are several optional logging levels which can be specified. They work in accordance with the severity levels of syslog. The levels are named as follows:

September 12, 2014, at 04:00 PM by liviu -
Added lines 759-776:

xlog([log_level, ]format_string)

Allows various debugging / runtime / critical messages to be printed as the execution of the OpenSIPS script is done. All pseudo-variables included in the **format_string** parameter will be expanded. There are several optional logging levels which can be specified. They work in accordance with the severity levels of syslog. The levels are named as follows:

L_ALERT (-3) L_CRIT (-2) L_ERR (-1) - this is used by default if log_level is omitted L_WARN (0) L_NOTICE (1) L_INFO (2) L_DBG (3)

    # a few xlog scripting examples
    xlog("Received $rm from $fu (callid: $ci)\n");
    xlog("L_ERR", "key $var(username) not found in cache!\n");
August 12, 2014, at 02:16 PM by razvancrainea -
Changed line 397 from:

raise_event(string[, avp[, avp]])

to:

raise_event(string[, avp[, avp ] ] )

August 12, 2014, at 12:19 PM by liviu -
Changed line 658 from:

Changes the debug level of the current process from script. If called without the parameter then the debug level of the current process will be reset its default level. This function is very helpful if you are tracing and debugging only a specific piece of code.

to:

Changes the debug level of the current process from script. If called without the parameter then the debug level of the current process will be reset to its default level. This function is very helpful if you are tracing and debugging only a specific piece of code.

August 12, 2014, at 12:19 PM by liviu -
Changed lines 658-659 from:

Changes the debug level of the current process from script. If called without the parameter then the debug level of the current process will be reset to the global level. If the debug level of the current process is changed then changing the global debug level (using MI function) does not affect it, so be careful and make sure to reset the process debug level when you are done. This function is very helpful if you are tracing and debugging only a specific piece of code.

to:

Changes the debug level of the current process from script. If called without the parameter then the debug level of the current process will be reset its default level. This function is very helpful if you are tracing and debugging only a specific piece of code.

Changed line 668 from:
      setdebug(); # reset the debug level of the current process to the global level
to:
      setdebug(); # reset the debug level of the current process to its default level

Page last modified on April 03, 2024, at 02:47 PM