Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. Put the following in your sip.xml:
    Code Block
    xml
    xml
    titlesip.xmlxml
    <sipapp>
      ...
      <servlet>
        <servlet-name>groovy</servlet-name>
        <servlet-class>org.cipango.groovy.GroovyServlet</servlet-class>
        <init-param>
          <param-name>defaultScript</param-name>
          <param-value>addHeader.groovy</param-value>
        </init-param>
        <load-on-startup/>
      </servlet>
    </sipapp>
    
  2. Add the scripts {requests.groovy}} and responses.groovy in WEB-INF/groovy.
  3. Add groovy-all-xyz.jar and cipango-groovy-xyz.jar into WEB-INF/lib.

...

request script adding a header and proxy the request

Code Block
xml
xml
titlerequests.groovyxml
request.addHeader("P-Asserted-Identity", "sip:bob@cipango.voip")
proxy()

response script adding a header and logging

Code Block
xml
xml
titleresponses.groovyxml
response.addHeader("Handled-By", "Cipango-Groovy")
println response