let find_call idx call =
    let rec find l = match l with
      | [] ->  raise Not_found
      | (call1, e1) :: tl ->
          let sid = call.sid in
          let sid1 = call1.sid in
          if sid = sid1 then e1
          else if sid < sid1 then raise Not_found
          else find tl
    in
    find idx.calls