[Devel] CVS commitlog: sip-server Makefile.defs action.c cfg.lex cfg.y items.c items.h sip-server/modules/avpops README avpops.c avpops_impl.c avpops_impl.h sip-server/modules/avpops/doc avpops_user.sgml sip-server/modules/unixodbc val.c

Daniel-Constantin Mierla daniel at voice-system.ro
Fri Feb 2 16:32:27 CET 2007


User: miconda 
Date: 2007/02/02 07:32:27 PST

  OpenSER CVS - Commit Details

  Modified files:
    .                    Makefile.defs action.c cfg.lex cfg.y 
                         items.c items.h 
    modules/avpops       README avpops.c avpops_impl.c 
                         avpops_impl.h 
    modules/avpops/doc   avpops_user.sgml 
    modules/unixodbc     val.c 
  Commit Log:
  - avp_aliases parameter removed from avpops module
  - avp_aliases added as global parameter in config file. For example:
  
  modparam("avpops","avp_aliases","uuid=I:660;email=s:email_addr;fwd=i:753")
    goes in
  avp_aliases="uuid=I:660;email=s:email_addr;fwd=i:753"
  
  - avp_write() function from avpops removed, same functionality is
  provided now by assignments in config file
  
  - escape/unescape functions from unixodb moved in core
  
  - new concept of 'transformation' -- this are functions that can be applied to the value of a pseudo-variable (PV), without altering its value
  - the format is '{id[,parameters]}' and they can be used inside parenthesis of pseudo-variables (note that even short name pseudo-variables must be enclosed in '(' and ')' to be able to apply transformations)
  - for example
          - $(ru{s.len}) - returns the lenth of R-URI
          - $(avp(i:3){s.md5}) - returs the md5 string over value of $avp(i:3)
  - the following classes of transformations are implemented
  
  1) string - the name of transformation starts with 's.'. Available transformations in this class:
          - {s.len} - returns strlen of PV value
          - {s.md5} - returs md5 over PV value
          - {s.substr,offset,length} - returns substring starting at offset having
          size of 'length'. If offset is negative, then it is counted from the end of
          PV value, -1 being the last char. In case of positive value, 0 is first
          char. Length must be positive, in case of 0, substring to the end of
          PV value is returned. offset and length can be PV as well. Example:
          "abcd"{s.substr,1,0} = "bcd"
          - {s.select,index,separator} - returns a field from PV value. The field is
          selected based on separator and index. The separator must be a character
          used to identify the fields. Index must be a integer value or a PV. If
          index is negative, the count of fields starts from end of PV value, -1
          being last field. If index is positive, 0 is the first field. Example:
          "12,34,56"{s.select,1,,} = "34" ; "12,34,56"{s.select,-2,,} = "12"
          - {s.encode.hexa} - returns encoding in hexa of PV value
          - {s.decode.hexa} - returns decoding from hexa of PV value
          - {s.escape.common} - returns escaped string of PV value. Characters escaped
          are ''', '"', '\' and 0. Useful when doing DB queries (care should be
          taken for non latin character set)
          - {s.unescape.common} - returns unescaped string of PV value. Reverse of
          above transformation.
  2) uri - the name of transformation starts with 'uri.'. The PV value is considered to be a SIP URI. This transformation returns parts of SIP URI (see struct sip_uri). Available transformations in this class:
          - {uri.user} - returns the user part
          - {uri.host} or {uri.domain} - returns the domain part
          - {uri.passwd} - returns the password
          - {uri.port} - return the port
          - {uri.params} - returs the URI parameters in a string
          - {uri.param,name} - returns the value of parameter with name 'name'
          - {uri.headers} - returns URI headers
          - {uri.transport} - returns the value of transport parameter
          - {uri.ttl} - returns the value of ttl parameter
          - {uri.uparam} - returns the value of user parameter
          - {uri.maddr} - return the value of maddr parameter
          - {uri.method} - return the value of method parameter
          - {uri.lr} - return the value of lr parameter
          - {uri.r2} - return the value of r2 parameter
  3) parameters list - the name of the transformation starts with 'param.'. The PV value is considered to be a string like "name1=value1;name2=value2;...". The transformations returns the value for a specific parameter, or the name of a parameter at a specific index. Available transformations in this class:
          - {param.value,name} - return the value of parameter 'name'
          Example: "a=1;b=2;c=3"{param.value,c} = "3"
          - {param.name,index} - return the name of parameter at position 'index'.
          Example: "a=1;b=2;c=3"{param.name,1} = "b"
  
  - within a PV, many transformation can be applied, being executed from left to right. Example:
          $var(x) = "a=1;b=22;c=333";
          $(var(x){param.value,$(var(x){param.name,1})}{s.len}) = 2
          - the length of the value of parameter at postion 1 (remember 0 is first
          postion, 1 is second postion)
  - the transformations can be used anywhere, being considered parts of PV --
  in xlog, avpops or other modules' functions and parameters, in right side
  assignment expressions or in comparisons.
  
  Revision  Changes    Path
  1.89      +2 -2      sip-server/Makefile.defs
   [ http://openser.cvs.sourceforge.net/openser/sip-server/Makefile.defs?r1=1.88&r2=1.89 ]
  1.27      +1 -4      sip-server/action.c
   [ http://openser.cvs.sourceforge.net/openser/sip-server/action.c?r1=1.26&r2=1.27 ]
  1.33      +5 -5      sip-server/cfg.lex
   [ http://openser.cvs.sourceforge.net/openser/sip-server/cfg.lex?r1=1.32&r2=1.33 ]
  1.42      +12 -1     sip-server/cfg.y
   [ http://openser.cvs.sourceforge.net/openser/sip-server/cfg.y?r1=1.41&r2=1.42 ]
  1.46      +181 -94   sip-server/items.c
   [ http://openser.cvs.sourceforge.net/openser/sip-server/items.c?r1=1.45&r2=1.46 ]
  1.31      +9 -6      sip-server/items.h
   [ http://openser.cvs.sourceforge.net/openser/sip-server/items.h?r1=1.30&r2=1.31 ]
  1.22      +25 -40    sip-server/modules/avpops/README
   [ http://openser.cvs.sourceforge.net/openser/sip-server/modules/avpops/README?r1=1.21&r2=1.22 ]
  1.30      +1 -112    sip-server/modules/avpops/avpops.c
   [ http://openser.cvs.sourceforge.net/openser/sip-server/modules/avpops/avpops.c?r1=1.29&r2=1.30 ]
  1.35      +4 -73     sip-server/modules/avpops/avpops_impl.c
   [ http://openser.cvs.sourceforge.net/openser/sip-server/modules/avpops/avpops_impl.c?r1=1.34&r2=1.35 ]
  1.16      +1 -4      sip-server/modules/avpops/avpops_impl.h
   [ http://openser.cvs.sourceforge.net/openser/sip-server/modules/avpops/avpops_impl.h?r1=1.15&r2=1.16 ]
  1.24      +20 -63    sip-server/modules/avpops/doc/avpops_user.sgml
   [ http://openser.cvs.sourceforge.net/openser/sip-server/modules/avpops/doc/avpops_user.sgml?r1=1.23&r2=1.24 ]
  1.4       +7 -77     sip-server/modules/unixodbc/val.c
   [ http://openser.cvs.sourceforge.net/openser/sip-server/modules/unixodbc/val.c?r1=1.3&r2=1.4 ]



More information about the Devel mailing list