How to detect silent mode ON

I have finished my first game but the market rejected it for the following reason.

* When silent mode is ON(Mute is ON), the game sounds also should be muted.
(this is the only one issue to be rejected. Mute toggle button is where Wi-Fi toggle button, Bluetooth toggle button is.)

I’ve spent my time to search the solution in forum and google, but failed.
I need to know when a silent mode is ON to make game sound also muted whenever user switchs Volume state.

Is there a way to know silent mode is ON like volume key?

To detect Volume Key is pressed, usually we put the code like

[blockcode]
local function hardwareKey(event)
if event.keyName == ‘VolumeUp’ and event.phase == ‘down’ then
// put the code
end

return true
end

Runtime:addEventListener(‘key’, hardwareKey)
[/blockcode]

What I want is,

[blockcode]
local function silentState(event)
if (silent button) == ‘ON’ then
// disable playing sounds
else
// play sounds
end
return true
end

Runtime:addEventListener(‘button’, silentState)
[/blockcode]

[import]uid: 142592 topic_id: 29769 reply_id: 329769[/import]