@ -96,8 +96,8 @@ sub PATCH :Allow {
last unless $ txn_ok ;
last unless $ txn_ok ;
$ item = $ self - > fetch_item ( $ c , $ resource , $ form , $ item ) ;
$ item = $ self - > fetch_item ( $ c , $ resource , $ form , $ item ) ;
last unless $ item ;
if ( $ item ) {
if ( 'minimal' eq $ preference ) {
if ( 'minimal' eq $ preference ) {
$ c - > response - > status ( HTTP_NO_CONTENT ) ;
$ c - > response - > status ( HTTP_NO_CONTENT ) ;
$ c - > response - > header ( Preference_Applied = > 'return=minimal' ) ;
$ c - > response - > header ( Preference_Applied = > 'return=minimal' ) ;
@ -113,6 +113,10 @@ sub PATCH :Allow {
$ c - > response - > header ( Location = > sprintf ( '%s%s' , $ self - > dispatch_path , $ item - > id ) ) ;
$ c - > response - > header ( Location = > sprintf ( '%s%s' , $ self - > dispatch_path , $ item - > id ) ) ;
$ c - > response - > body ( $ response - > content ) ;
$ c - > response - > body ( $ response - > content ) ;
}
}
} else {
$ c - > response - > status ( HTTP_NO_CONTENT ) ;
$ c - > response - > body ( q( ) ) ;
}
}
}
return ;
return ;
@ -152,8 +156,8 @@ sub PUT :Allow {
last unless $ txn_ok ;
last unless $ txn_ok ;
$ item = $ self - > fetch_item ( $ c , $ resource , $ form , $ item ) ;
$ item = $ self - > fetch_item ( $ c , $ resource , $ form , $ item ) ;
last unless $ item ;
if ( $ item ) {
if ( 'minimal' eq $ preference ) {
if ( 'minimal' eq $ preference ) {
$ c - > response - > status ( HTTP_NO_CONTENT ) ;
$ c - > response - > status ( HTTP_NO_CONTENT ) ;
$ c - > response - > header ( Preference_Applied = > 'return=minimal' ) ;
$ c - > response - > header ( Preference_Applied = > 'return=minimal' ) ;
@ -169,6 +173,10 @@ sub PUT :Allow {
$ c - > response - > header ( Location = > sprintf ( '%s%s' , $ self - > dispatch_path , $ item - > id ) ) ;
$ c - > response - > header ( Location = > sprintf ( '%s%s' , $ self - > dispatch_path , $ item - > id ) ) ;
$ c - > response - > body ( $ response - > content ) ;
$ c - > response - > body ( $ response - > content ) ;
}
}
} else {
$ c - > response - > status ( HTTP_NO_CONTENT ) ;
$ c - > response - > body ( q( ) ) ;
}
}
}
return ;
return ;
@ -195,7 +203,7 @@ sub delete_item {
return unless ( $ sub ) ;
return unless ( $ sub ) ;
NGCP::Panel::Utils::Kamailio:: delete_location_contact ( $ c ,
NGCP::Panel::Utils::Kamailio:: delete_location_contact ( $ c ,
$ sub , $ item - > contact ) ;
$ sub , $ item - > contact ) ;
NGCP::Panel::Utils::Kamailio:: flush ( $ c ) ;
NGCP::Panel::Utils::Kamailio:: flush ( $ c ) unless $ self - > suppress_flush ( $ c ) ;
return 1 ;
return 1 ;
}
}