beautypg.com

Grandstream GXP2200 GMI Web Service Guide User Manual

Page 22

background image

GXP2200 GMI WEB SERVICE GUIDE V1.0

Page 21 of 38

22. setPhonebook(phbkConfigure, flag, callbackFunction)

Description

• Phonebook import/export
• Phonebook configuration structure

phbkConfigure

{

mode; //Download mode. 0 - OFF; 1 - TFTP; 2 - HTTP

url; //Phonebook download URL

interval; //Automatic download interval

redup; //Replace duplicate items. 0 - No; 1 - Yes

clearold; //Clear old list. 0 - No; 1 - Yes

filetype; //Phonebook file format. 0 - XML; 2 - CSV

encode; //Phonebook file encoding format. UTF-8 or GBK

}

Parameters

• phbkConfigure: Phonebook download configuration
• flag: For import/export
• callbackFunction: Call back function

HTTP Request

1. Export phonebook

(1) Save configuration
• url: "http://"+ ip + "/manager?"
• action: "putportphbk"
• flag: "0"
• opmode: "1"
• portEncode: "UTF-8"
• portType: "0"
• format: "json"
• jsoncallback: "?" (This is the HTTP request for the call back function, usually used in

AJAX and JQuery)

• For example:

http://192.168.121.230/manager?action=putportphbk&opmode=1&flag=0&portType

=0&portEncode=UTF-8&format=json&jsoncallback=?

(2) Save phonebook.xml
• url: "http://"+ ip + "/manager?"
• action: "savephbk"
• format: "json"
• jsoncallback ——"?"
• For example,

http://192.168.121.230/manager?action=savephbk&format=json&jsoncallback=?

(3) When "savephbk" succeed, the phoneook.xml will be exported to the phone.then

you can download the phonebook.xml from link as follow: