anchor.diff:      NoteTypes = [{<<"inbound">>, 10}
                   ,{<<"outbound">>, 11}
                   ],
  -    Link = 
  -        case kz_json:get_value([<<"custom_channel_vars">>,<<"media_recording_id">>], JObj) of
  -            'undefined' -> 'undefined';
  -            MediaId ->
  -                <<"https://beta.onnet.su/kzattachment"
  -                 ,"?account_id=", AccountId/binary
  -                 ,"&doc_type=call_recording"
  -                 ,"&recording_id=", MediaId/binary
  -                 ,"&auth_token=recording">>
  -        end,
       Values = props:filter_empty(
           [{<<"element_id">>, kz_json:get_value(<<"id">>, Contact)}
           ,{<<"element_type">>, props:get_value(kz_json:get_value(<<"type">>, Contact), ElementTypes, 1)}
  
positive.code:         ,{[<<"params">>,<<"UNIQ">>], kz_json:get_value(<<"call_id">>, JObj)}
          ,{[<<"params">>,<<"PHONE">>], caller_number(JObj)}
          ,{[<<"params">>,<<"DURATION">>], kz_json:get_value(<<"billing_seconds">>, JObj)}
          ,{[<<"params">>,<<"LINK">>], Link}
          ,{[<<"params">>,<<"SRC">>], <<"kzonnet">>}
          ]),
      kz_json:set_values(Values, kz_json:new()).
  
negative.code:     end.
  
  compose_note(JObj, Contact) ->
      ElementTypes = [{<<"contact">>, 1}
                     ,{<<"lead">>, 2}
                     ,{<<"company">>, 3}
  