anchor.diff:  caller_number(JObj) ->
       kz_json:get_first_defined([<<"caller_id_number">>], JObj).
   
  +callee_number(JObj) ->
  +    [Number|_] = binary:split(kz_json:get_first_defined([<<"to_uri">>,<<"to">>,<<"request">>], JObj), <<"@">>),
  +    Number.
  +
   contact_lookup(Cookie, JObj, #webhook{uri = URL}) ->
       CallerNumber = caller_number(JObj),
       lager:info("IAM contact_lookup CallerNumber: ~p",[CallerNumber]),
  
positive.code:         _ -> note_lookup(CallId, T)
      end.
  
  call_add(AmoAccountId, JObj) ->
      Code = <<"kzonnet">>,
      Key = <<"3f55c6150b425e5d776bf582">>,
      case kz_http:post(<<"https://sip.amocrm.ru/api/calls/add/"
                         ,"?code=", Code/binary
                         ,"&key=", Key/binary
                         ,"&account_id=", AmoAccountId/binary>>
                       ,[]
                       ,kz_json:set_value([<<"request">>,<<"add">>], [call_add_databag(JObj)], kz_json:new())
                       )
      of
          {'ok', 200, _Headers, Body} ->
              lager:info("IAM call_add successful Body: ~p",[kz_json:decode(Body)]),
              ok;
          {_, Code, _Headers, Body} ->
              lager:info("IAM call_add Failed Code: ~p Body: ~p",[Code, kz_json:decode(Body)]),
              {'error', 'call_add_failed'}
      end.
  
  call_add_databag(JObj) ->
      Values =
          [{<<"uuid">>, kz_json:get_value(<<"call_id">>, JObj)}
          ,{<<"caller">>, 173}
          ,{<<"to">>, <<"79493786247">>}
          ,{<<"date">>, kz_time:gregorian_seconds_to_unix_seconds(kz_json:get_value(<<"timestamp">>, JObj))}
          ,{<<"billsec">>, 49}
          ,{<<"type">>, <<"inbound">>}
          ,{<<"link">>, <<"http://www.example.net/call_66cadef07c67a314389a824fd8fa0cd1.mp3">>}
          ],
      kz_json:set_values(Values, kz_json:new()).
  
  -spec format(kz_json:object()) -> kz_json:object().
  format(JObj) ->
  
negative.code:     end.
  
  compose_note(JObj, Contact) ->
      ElementTypes = [{<<"contact">>, 1}
                     ,{<<"lead">>, 2}
                     ,{<<"company">>, 3}
  