TT#26101 Add recordings hal links to the conversations

Change-Id: Id95d76e12a4a4ba20f9a4be56c365000bbaa0aca
changes/02/16802/6
Irina Peshinskaya 8 years ago
parent 891f378f6d
commit 5475944552

@ -858,17 +858,24 @@ sub hal_links {
my($self, $c, $item, $resource, $form) = @_;
#$c->log->debug("hal_links: type=".($resource->{type} // 'undefined')."; id=".($resource->{id} // 'undefined').";");
return [
('call' eq $resource->{type} ?
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:calls', href => sprintf("/api/calls/%d", $resource->{id})) : ()),
('voicemail' eq $resource->{type} ?
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:voicemails', href => sprintf("/api/voicemails/%d", $resource->{id})) : ()),
('sms' eq $resource->{type} ?
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:sms', href => sprintf("/api/sms/%d", $resource->{id})) : ()),
('fax' eq $resource->{type} ?
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:faxes', href => sprintf("/api/faxes/%d", $resource->{id})) : ()),
('call' eq $resource->{type} ? (
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:calls', href => sprintf("/api/calls/%d", $resource->{id})),
) : ()),
('voicemail' eq $resource->{type} ? (
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:voicemails', href => sprintf("/api/voicemails/%d", $resource->{id})),
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:voicemailrecordings', href => sprintf("/api/voicemailrecordings/%d", $resource->{id})),
) : ()),
('sms' eq $resource->{type} ? (
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:sms', href => sprintf("/api/sms/%d", $resource->{id})),
) : ()),
('fax' eq $resource->{type} ? (
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:faxes', href => sprintf("/api/faxes/%d", $resource->{id})),
NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:faxrecordings', href => sprintf("/api/faxrecordings/%d", $resource->{id})),
) : ()),
# todo - add xmpp mam rail:
#('xmpp' eq $item->{type} ?
# NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:xmpp', href => sprintf("/api/xmpp/%d", $item->{id})) : ()),
#('xmpp' eq $item->{type} ? (
# NGCP::Panel::Utils::DataHalLink->new(relation => 'ngcp:xmpp', href => sprintf("/api/xmpp/%d", $item->{id})),
# ) : ()),
];
}

Loading…
Cancel
Save