Versions Compared

Key

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

REST URL pattern

sipXivr listens for http requests by default on port 8085.

Requests All requests are authenticated using DIGEST authentication and SSL protected

 curl --digest -k --request GET|PUT|DELETE https://{user}:{password}@localhost:8085/mailbox/{mailbox}/{request}

To test the service with curl use:General URL structure.

API

Base URL: https://{userhost name}:{password}@localhost:8085/mailbox/{mailbox}
Common prefix: {mailbox} is the mailbox to work with.  The mailbox of a user is the user's main <username> as found in validusers.xml

MWI Services

Provides the ability to query the status of, and update the Message Waiting Indicators associated with a mailbox
   /mwi  PUT (no body) user id}

URL

METHOD

Description

/mwi

PUT w/no body

Updates the MWI for this mailbox (i.e. tells the status server

...

 

GET

Returns the MWI status for this mailbox

...

in

...

...

format

...

.

...

Content-Type is set to application/simple-message-summary

Example

Code Block

To get the MWI status for User 200, do this:
   curl --digest -k --request GET https://200:123@localhost:8085/mailbox/200/mwi
The response looks like:
   Messages-Waiting: no
   Voice-Message: 0/3 (0/0)

Messages Services

Provides the ability to query the status of, and mark a message as heard/unheard.

/messages

GET

returns all messages in mailbox

...

/message/{messageid}

GET

where {messageid} is the unique message ID for the message, an 8 digit number.

...

/heard

PUT (no body)

Marks the message heard (and updates MWI

...

 

...

GET

returns message heard status.

...

The body returned is the XML fragment

...

: <heard>true|false</heard>

 

DELETE

...

DELETE Marks the message unheard (and updates MWI)

...

/delete

...

PUT (no body)

Moves the message to Trash folder

...

Example

...

/preferences/activegreeting

PUT with body

Code Block
<activegreeting>{value}\</activegreeting>

where {value} is one of :
none
standard
out of office
extended absence

sets the active greeting

 

GET

returns the active greeting (returns above fragment)

 

DELETE

sets the active greeting to none

Examples

Code Block
titleExample getting voicemail messages using curl from CLI

$curl --digest -k --request GET https://200:123@localhost:8085/mailbox/200/mwi
Messages-Waiting: no
Voice-Message: 0/3 (0/0)
Code Block
titleTo mark User 200's message 00000080 as heard

$curl  --digest -k --request PUT https://200:123@localhost:8085/mailbox/200/message/00000080/heard

Code Block
titleTo
delete
a
message
$curl    curl --digest -k --request PUT https://200:123@localhost:8085/mailbox/200/message/00000018/delete

Code Block
titleGet
all
messages
  $curl curl --digest -k --request GET https://200:123@localhost:8085/mailbox/200/messages
   returns
 
 <message id=00000018 heard=true urgent=false folder=deleted duration=0 received=1171062204000/>

Preferences Services (not implemented yet)

Provides the ability to query and set the value of the User's Active Voicemail Greeting type.

   /preferences/
   /activegreeting PUT sets the active greeting

                                 body is the XML fragment  <activegreeting>{value}\</activegreeting>

                                 where {value} is one of none, standard, out of office, extended absence

                          GET returns the active greeting (returns above fragment)
                          DELETE sets the active greeting to "none"

Example

To query User 200's active greeting preference, do this:    curl 
Code Block
Code Block
titleUser 200's active greeting preference

$curl  --digest -k --request GET https://200:123@localhost:8085/mailbox/200/preferences/activegreeting
The response looks like:
  
standard

Conference Services

Provides the ability to send conference commands to freeswitch

Code Block

usage: curl --digest -k -X PUT https://200:123@&lt;host_name&gt;:8085/conference/item1/item2/item3
means the command: conference item1 item2 item3

Example

Code Block

curl --digest -k -X PUT https://200:123@localhost:8085/conference/mirceaConf/lock
means: conference mirceaConf lock
returns:
<command-response>OK mirceaConf locked
</command-response>

Basically, freeswitch exposes the following set of commands:

Code Block

<confname> list [delim <string>]
<confname> xml_list
<confname> energy <member_id|all|last> [<newval>]
<confname> volume_in <member_id|all|last> [<newval>]
<confname> volume_out <member_id|all|last> [<newval>]
<confname> play <file_path> [async|<member_id>]
<confname> say <text>
<confname> saymember <member_id> <text>
<confname> stop <[current|all|async|last]> [<member_id>]
<confname> dtmf <[member_id|all|last]> <digits>
<confname> kick <[member_id|all|last]>
<confname> mute <[member_id|all]|last>
<confname> unmute <[member_id|all]|last>
<confname> deaf <[member_id|all]|last>
<confname> undeaf <[member_id|all]|last>
<confname> relate <member_id> <other_member_id> [nospeak|nohear|clear]
<confname> lock
<confname> unlock
<confname> dial <endpoint_module_name>/<destination> <callerid number> <callerid name>
<confname> bgdial <endpoint_module_name>/<destination> <callerid number> <callerid name>
<confname> transfer <conference_name> <member id> [...<member id>]
<confname> record <filename>
<confname> norecord <[filename|all]>
<confname> pin <pin#>
<confname> nopin