@ -21,7 +21,7 @@
* \ brief JSON abstraction layer .
* \ brief JSON abstraction layer .
*
*
* This is a very thin wrapper around the Jansson API . For more details on it ,
* This is a very thin wrapper around the Jansson API . For more details on it ,
* see its docs at http : //www.digip.org/jansson/doc/2. 4 /apiref.html.
* see its docs at http : //www.digip.org/jansson/doc/2. 11 /apiref.html.
*
*
* \ author David M . Lee , II < dlee @ digium . com >
* \ author David M . Lee , II < dlee @ digium . com >
*/
*/
@ -747,37 +747,15 @@ static struct ast_json *json_party_subaddress(struct ast_party_subaddress *subad
struct ast_json * ast_json_party_id ( struct ast_party_id * party )
struct ast_json * ast_json_party_id ( struct ast_party_id * party )
{
{
RAII_VAR ( struct ast_json * , json_party_id , NULL , ast_json_unref ) ;
int pres = ast_party_id_presentation ( party ) ;
int pres ;
/* Combined party presentation */
/* Combined party presentation */
pres = ast_party_id_presentation ( party ) ;
return ast_json_pack ( " {s: i, s: s, s: o*, s: o*, s: o*} " ,
json_party_id = ast_json_pack ( " {s: i, s: s} " ,
" presentation " , pres ,
" presentation " , pres ,
" presentation_txt " , ast_describe_caller_presentation ( pres ) ) ;
" presentation_txt " , ast_describe_caller_presentation ( pres ) ,
if ( ! json_party_id ) {
" number " , json_party_number ( & party - > number ) ,
return NULL ;
" name " , json_party_name ( & party - > name ) ,
}
" subaddress " , json_party_subaddress ( & party - > subaddress ) ) ;
/* Party number */
if ( party - > number . valid
& & ast_json_object_set ( json_party_id , " number " , json_party_number ( & party - > number ) ) ) {
return NULL ;
}
/* Party name */
if ( party - > name . valid
& & ast_json_object_set ( json_party_id , " name " , json_party_name ( & party - > name ) ) ) {
return NULL ;
}
/* Party subaddress */
if ( party - > subaddress . valid
& & ast_json_object_set ( json_party_id , " subaddress " , json_party_subaddress ( & party - > subaddress ) ) ) {
return NULL ;
}
return ast_json_ref ( json_party_id ) ;
}
}
enum ast_json_to_ast_vars_code ast_json_to_ast_variables ( struct ast_json * json_variables , struct ast_variable * * variables )
enum ast_json_to_ast_vars_code ast_json_to_ast_variables ( struct ast_json * json_variables , struct ast_variable * * variables )