class Uacsta
def send(sip_account, domain, body)
require 'freeswitch_event'
event = FreeswitchEvent.new("NOTIFY")
event.add_header("profile", "gemeinschaft")
event.add_header("event-string", "uaCSTA")
event.add_header("user", sip_account)
event.add_header("host", domain)
event.add_header("content-type", "application/csta+xml")
event.add_body(body);
return event.fire();
end
def make_call(sip_account, domain, number)
body = '
' + sip_account.to_s + '
' + number.to_s + '
doNotPrompt
'
self.send(sip_account, domain, body);
end
def answer_call(sip_account, domain)
body = '
' + sip_account + '
'
self.send(sip_account, domain, body)
end
def set_microphone_mute(sip_account, domain, value)
body = '
' + sip_account + '
1
' + value.to_s + '
'
self.send(sip_account, domain, body)
end
def set_speaker_volume(sip_account, domain, value)
body = '
' + sip_account + '
1
' + value.to_s + '
'
self.send(sip_account, domain, body)
end
def set_do_not_disturb(sip_account, domain, value)
body = '
' + sip_account + '
' + value.to_s + '
'
self.send(sip_account, domain, body)
end
def set_forwarding(sip_account, domain, forwarding_type, number, activate)
forwarding_types = [ "forwardImmediate", "forwardBusy", "forwardNoAns" ]
body = '
' + sip_account + '
' + forwarding_types[forwarding_type.to_i] + '
' + number.to_s + '
' + activate.to_s + '
'
self.send(sip_account, domain, body)
end
end